GS2-Money2 SDK API リファレンス

各種プログラミング言語向け GS2-Money2 SDK の モデルの仕様 と API のリファレンス

モデル

Namespace

ネームスペース

ネームスペースは、一つのプロジェクト内で同じサービスを異なる用途で複数利用するためのエンティティです。
GS2 の各サービスはネームスペース単位で管理されます。ネームスペースが異なれば、同じサービスでも完全に独立したデータ空間として扱われます。

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

詳細
有効化条件必須デフォルト値の制限説明
namespaceIdstring
~ 1024文字ネームスペース GRN
※ サーバーが自動で設定
namestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
descriptionstring~ 1024文字説明文
transactionSettingTransactionSettingトランザクション設定
通貨の入金・出金時に使用される分散トランザクションの設定です。
currencyUsagePriority文字列列挙型
enum {
  “PrioritizeFree”,
  “PrioritizePaid”
}
消費優先度
ウォレットから出金する際に有償通貨と無償通貨のどちらを先に消費するかを決定します。“PrioritizeFree” は無償通貨を優先し、“PrioritizePaid” は有償通貨を優先します。
定義説明
“PrioritizeFree”無償通貨を優先して使用する
“PrioritizePaid”有償通貨を優先して使用する
sharedFreeCurrencybool
無償通貨を異なるスロットで共有するか
有効にすると、無償通貨の残高がすべてのウォレットスロット(プラットフォーム)間で共有されます。有償通貨はスロットごとに分離されたままです。この設定はネームスペース作成時のみ設定可能で、後から変更できません。
platformSettingPlatformSetting
ストアプラットフォーム設定
サポートされている各ストアプラットフォーム(Apple App Store、Google Play、テスト用Fake)の設定です。各プラットフォームでのレシート検証に必要な認証情報やキーを含みます。
depositBalanceScriptScriptSettingウォレット残高を加算したときに実行するスクリプトの設定
Script トリガーリファレンス - deposit
withdrawBalanceScriptScriptSettingウォレット残高を消費したときに実行するスクリプトの設定
Script トリガーリファレンス - withdraw
verifyReceiptScriptScriptSettingレシート検証を実行したときに実行するスクリプトの設定
Script トリガーリファレンス - verifyReceipt
subscribeScriptstring~ 1024文字期間課金を新規契約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない/一度契約失効後に再度契約した場合も呼び出される)
Script トリガーリファレンス - subscribe
renewScriptstring~ 1024文字期間課金を更新するときに実行する GS2-Script スクリプトGRN
Script トリガーリファレンス - renew
unsubscribeScriptstring~ 1024文字期間課金を解約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない)
Script トリガーリファレンス - unsubscribe
takeOverScriptScriptSetting期間課金に紐づけられたユーザーを変更するときに実行するスクリプトの設定
Script トリガーリファレンス - takeOver
changeSubscriptionStatusNotificationNotificationSetting期間課金の契約状況が変化したときのプッシュ通知
サブスクリプションのステータスが変化した際(有効化、更新、解約、期限切れ、取り消しなど)に GS2-Gateway を通じて配信されるプッシュ通知の設定です。ゲームクライアントがサブスクリプション状態の変化にリアルタイムで対応できるようにします。
logSettingLogSettingログの出力設定
このネームスペースに対するAPIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。入金、出金、レシート検証、サブスクリプションイベントの追跡に役立ちます。
createdAtlong
現在時刻作成日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
updatedAtlong
現在時刻最終更新日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

TransactionSetting

トランザクション設定

トランザクション設定は、トランザクションの実行方法・整合性・非同期処理・競合回避の仕組みを制御する設定です。
自動実行(AutoRun)、アトミック実行(AtomicCommit)、GS2-Distributor を利用した非同期実行、スクリプト結果の一括適用、GS2-JobQueue による入手アクションの非同期化などを組み合わせ、ゲームロジックに応じた堅牢なトランザクション管理を可能にします。

詳細
有効化条件必須デフォルト値の制限説明
enableAutoRunboolfalse発行したトランザクションをサーバーサイドで自動的に実行するか
enableAtomicCommitbool{enableAutoRun} == truefalseトランザクションの実行をアトミックにコミットするか
※ enableAutoRun が true であれば 有効
transactionUseDistributorbool{enableAtomicCommit} == truefalseトランザクションを非同期処理で実行する
※ enableAtomicCommit が true であれば 有効
commitScriptResultInUseDistributorbool{transactionUseDistributor} == truefalseスクリプトの結果コミット処理を非同期処理で実行するか
※ transactionUseDistributor が true であれば 有効
acquireActionUseJobQueuebool{enableAtomicCommit} == truefalse入手アクションを実行する際に GS2-JobQueue を使用するか
※ enableAtomicCommit が true であれば 有効
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024文字トランザクションの実行に使用する GS2-Distributor ネームスペース GRN
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024文字トランザクションの実行に使用する GS2-JobQueue のネームスペース GRN

ScriptSetting

スクリプト設定

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

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

一方、非同期実行ではスクリプトの完了を待つために処理がブロックされることはありません。
ただし、スクリプトの実行結果を利用して API の実行を停止したり、API の応答内容を変更することはできません。
非同期実行は API の応答フローに影響を与えないため、原則として非同期実行を推奨します。

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

詳細
有効化条件必須デフォルト値の制限説明
triggerScriptIdstring~ 1024文字API 実行時に同期的に実行される GS2-Script のスクリプト GRN
「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。
doneTriggerTargetType文字列列挙型
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none”非同期スクリプトの実行方法
非同期実行で使用するスクリプトの種類を指定します。
「非同期実行のスクリプトを使用しない(none)」「GS2-Scriptを使用する(gs2_script)」「Amazon EventBridgeを使用する(aws)」が選択できます。
定義説明
“none”なし
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字非同期実行する GS2-Script スクリプト GRN
「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。
※ doneTriggerTargetType が “gs2_script” であれば 有効
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字非同期実行スクリプトを実行する GS2-JobQueue ネームスペース GRN
非同期実行スクリプトを直接実行するのではなく、GS2-JobQueue を経由する場合は GS2-JobQueue のネームスペースGRN を指定します。
GS2-JobQueue を利用する理由は多くはありませんので、特に理由がなければ指定する必要はありません。
※ doneTriggerTargetType が “gs2_script” であれば 有効

NotificationSetting

プッシュ通知に関する設定

GS2 のマイクロサービス内で何らかのイベントが発生した際に、プッシュ通知を送信するための設定です。
ここでいうプッシュ通知は GS2-Gateway の提供する WebSocket インターフェースを経由した処理であり、スマートフォンのプッシュ通知とは性質が異なります。
たとえば、マッチメイキングが完了した時やフレンドリクエストが届いた時など、ゲームクライアントの操作とは関係なく状態が変化した際に GS2-Gateway を経由してプッシュ通知をすることで、ゲームクライアントは状態の変化を検知することができます。

GS2-Gateway のプッシュ通知は通知先のデバイスがオフラインだった時に追加の処理としてモバイルプッシュ通知を送信できます。
モバイルプッシュ通知をうまく利用すれば、マッチメイキング中にゲームを終了しても、モバイルプッシュ通知を使用してプレイヤーに通知し、ゲームに戻ってくるフローを実現できる可能性があります。

詳細
有効化条件必須デフォルト値の制限説明
gatewayNamespaceIdstring“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024文字プッシュ通知に使用する GS2-Gateway のネームスペース
「grn:gs2:」から始まる GRN 形式で GS2-Gateway のネームスペースIDを指定します。
enableTransferMobileNotificationbool?falseモバイルプッシュ通知へ転送するか
この通知を送信しようとした時、通知先のデバイスがオフラインだった場合、モバイルプッシュ通知へ転送するかどうかを指定します。
soundstring{enableTransferMobileNotification} == true~ 1024文字モバイルプッシュ通知で使用するサウンドファイル名
ここで指定したサウンドファイル名は、モバイルプッシュ通知を送信する際に使用され、特別なサウンドで通知を出すことができます。
※ enableTransferMobileNotification が true であれば 有効
enable文字列列挙型
enum {
  “Enabled”,
  “Disabled”
}
“Enabled”プッシュ通知を有効にするか
定義説明
“Enabled”有効
“Disabled”無効

LogSetting

ログの出力設定

ログデータの出力設定を管理します。この型は、ログデータを書き出すために使用される GS2-Log ネームスペースの識別子(Namespace ID)を保持します。
ログネームスペースID(loggingNamespaceId)には、ログデータを収集し保存する GS2-Log のネームスペースを、GRNの形式で指定します。
この設定をすることで、設定されたネームスペース内で発生したAPIリクエスト・レスポンスのログデータが、対象の GS2-Log ネームスペース側へ出力されるようになります。
GS2-Log ではリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。

詳細
有効化条件必須デフォルト値の制限説明
loggingNamespaceIdstring
~ 1024文字ログを出力する GS2-Log のネームスペース GRN
「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。

GitHubCheckoutSetting

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

詳細
有効化条件必須デフォルト値の制限説明
apiKeyIdstring
~ 1024文字GitHub APIキーの GRN
repositoryNamestring
~ 1024文字リポジトリ名
sourcePathstring
~ 1024文字マスターデータ(JSON)ファイルのパス
referenceType文字列列挙型
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
コードの取得元
定義説明
“commit_hash”コミットハッシュ
“branch”ブランチ
“tag”タグ
commitHashstring{referenceType} == “commit_hash”
✓※
~ 1024文字コミットハッシュ
※ referenceType が “commit_hash” であれば 必須
branchNamestring{referenceType} == “branch”
✓※
~ 1024文字ブランチ名
※ referenceType が “branch” であれば 必須
tagNamestring{referenceType} == “tag”
✓※
~ 1024文字タグ名
※ referenceType が “tag” であれば 必須

Wallet

ウォレット

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

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

詳細
有効化条件必須デフォルト値の制限説明
walletIdstring
~ 1024文字ウォレット GRN
※ サーバーが自動で設定
userIdstring
~ 128文字ユーザーID
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。
summaryWalletSummary
ウォレットの状態
ウォレットの現在の残高サマリーで、有償通貨、無償通貨、合計額に分けて表示されます。入金トランザクションから算出されます。
depositTransactionsList<DepositTransaction>[]0 ~ 1000 items入金トランザクションリスト
このウォレットへの全入金の記録です。各トランザクションは購入価格、通貨コード、数量、入金日時を追跡します。有償の入金(価格 > 0)は返金計算や法規制対応のために単価ごとに管理されます。
sharedFreeCurrencybool
無償通貨を共有するか
このウォレットの無償通貨がすべてのスロット間で共有されるかどうかを示します。ウォレット作成時にネームスペースの設定から継承されます。
createdAtlong
現在時刻作成日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
updatedAtlong
現在時刻最終更新日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

Event

イベント

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

詳細
有効化条件必須デフォルト値の制限説明
eventIdstring
~ 1024文字イベント GRN
※ サーバーが自動で設定
transactionIdstring
~ 1024文字トランザクションID
この決済イベントの一意の識別子です。レシート検証イベントの場合はストアプラットフォームのトランザクションIDに対応します。
userIdstring
~ 128文字ユーザーID
eventType文字列列挙型
enum {
  “VerifyReceipt”,
  “Deposit”,
  “Withdraw”,
  “Refund”
}
イベントの種類
決済イベントの種類です。“VerifyReceipt” はストアのレシート検証を、“Deposit” は通貨の追加を、“Withdraw” は通貨の消費を、“Refund” は返金処理を記録します。
定義説明
“VerifyReceipt”レシート検証
“Deposit”加算
“Withdraw”消費
“Refund”返金済み
verifyReceiptEventVerifyReceiptEventレシート検証イベント
レシート検証イベントの詳細です。eventType が “VerifyReceipt” の場合に設定されます。ストアコンテンツ名、プラットフォーム、プラットフォーム固有の検証結果を含みます。
depositEventDepositEvent入金イベント
入金イベントの詳細です。eventType が “Deposit” の場合に設定されます。ウォレットスロット、入金トランザクション、入金後のウォレット状態を含みます。
withdrawEventWithdrawEvent出金イベント
出金イベントの詳細です。eventType が “Withdraw” の場合に設定されます。ウォレットスロット、出金の詳細、出金後のウォレット状態を含みます。
refundEventRefundEvent返金イベント
返金イベントの詳細です。eventType が “Refund” の場合に設定されます。ストアコンテンツ名、プラットフォーム、プラットフォーム固有の返金情報を含みます。
createdAtlong
現在時刻作成日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

SubscribeTransaction

サブスクリプションの購入情報

ストアプラットフォームからのサブスクリプション購入レコードを表します。有効、トライアル、初回割引、猶予期間、解約、期限切れ、取り消しなどのライフサイクルを通じた詳細なサブスクリプションステータスを追跡します。各トランザクションは特定のストアプラットフォームとユーザーに紐づけられます。

詳細
有効化条件必須デフォルト値の制限説明
subscribeTransactionIdstring
~ 1024文字サブスクリプショントランザクション GRN
※ サーバーが自動で設定
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名
transactionIdstring
~ 1024文字トランザクションID
ストアプラットフォームによって割り当てられた一意のトランザクション識別子です。同一購入の重複処理を防止するために使用されます。
store文字列列挙型
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
ストア
購入が行われたストアプラットフォームです。レシート検証に使用される検証方法を決定します。
定義説明
“AppleAppStore”Apple App Store
“GooglePlay”Google Play
“fake”Fake
userIdstring~ 128文字ユーザーID
statusDetail文字列列挙型
enum {
  “active@active”,
  “active@converted_from_trial”,
  “active@in_trial”,
  “active@in_intro_offer”,
  “grace@canceled”,
  “grace@grace_period”,
  “grace@on_hold”,
  “inactive@expired”,
  “inactive@revoked”
}
ステータス
詳細なサブスクリプションステータスです。簡易カテゴリ(active/grace/inactive)の後に具体的な状態が続きます。active 状態はサブスクリプションが利用可能であることを、grace 状態は支払いに問題があるが一時的にアクセス可能であることを、inactive 状態はサブスクリプションが無効であることを示します。
定義説明
“active@active”有効
“active@converted_from_trial”無料トライアルが終了し、有料プランに移行
“active@in_trial”無料トライアル期間中
“active@in_intro_offer”初回割引期間中
“grace@canceled”ユーザーが手動で解約済み
“grace@grace_period”支払いが失敗したが、猶予期間内
“grace@on_hold”支払いが失敗し、一定期間内に支払いが完了しなければ利用不可
“inactive@expired”サブスクリプションが期限切れになった
“inactive@revoked”払い戻しなどで強制的にキャンセルされた
expiresAtlong
有効期限
このサブスクリプショントランザクションが期限切れになる日時です。ストアプラットフォームによってサブスクリプションが更新されると更新されます。
lastAllocatedAtlong最後にユーザーに割り当てられた日時
このサブスクリプショントランザクションが最後にユーザーに割り当てられた日時です。reallocateSpanDays と組み合わせて、サブスクリプションを別のユーザーに再割り当て可能かどうかを判定するために使用されます。
lastTakeOverAtlong最後に対象ユーザーが切り替えられた日時
このサブスクリプションに紐づくユーザーが最後に変更(引き継ぎ)された日時です。サブスクリプションのアカウント移行履歴を追跡します。
createdAtlong
現在時刻作成日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
updatedAtlong
現在時刻最終更新日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

SubscriptionStatus

サブスクリプションの契約状況

特定のサブスクリプションコンテンツに対するユーザーのサブスクリプション契約状況を追跡します。詳細なサブスクリプショントランザクションの状態から導出された簡易的な有効/無効ステータスと、有効期限、関連するサブスクリプショントランザクションのリストを提供します。

詳細
有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名
status文字列列挙型
enum {
  “active”,
  “inactive”
}
ステータス
簡易的なサブスクリプションステータスです。“active” は有効、トライアル、初回割引、猶予期間の状態を含みます。“inactive” は期限切れと取り消しの状態を含みます。
定義説明
“active”有効
“inactive”無効
expiresAtlong
有効期限
サブスクリプションが期限切れになる日時です。サブスクリプションが更新されたりステータスが変化した際に更新されます。
detailList<SubscribeTransaction>[]0 ~ 100 items契約状況の詳細
このサブスクリプションに関連するサブスクリプショントランザクションのリストです。各トランザクションはストアプラットフォームからの購入レコードで、詳細なステータス情報(有効、トライアル、猶予期間、期限切れ、取り消しなど)を持ちます。

RefundHistory

返金履歴情報

返金イベントを日付、ユーザー、返金の詳細とともに記録します。ストアプラットフォーム(Apple App Store、Google Play)で処理された返金トランザクションを追跡します。

詳細
有効化条件必須デフォルト値の制限説明
refundHistoryIdstring
~ 1024文字サブスクリプショントランザクション GRN
※ サーバーが自動で設定
transactionIdstring
~ 1024文字トランザクションID
ストアプラットフォームによって割り当てられた一意のトランザクション識別子です。同一購入の重複処理を防止するために使用されます。
yearint
2000 ~ 3000
monthint
1 ~ 12
dayint
1 ~ 31
userIdstring~ 128文字ユーザーID
detailRefundEvent
返金イベント情報
createdAtlong
現在時刻作成日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定

DailyTransactionHistory

日々の取引履歴

日次の取引データを集計します。通貨コード別の入金総額(売上)、出金総額(消費)、発行通貨数、消費通貨数を含みます。財務レポートやモニタリングに使用されます。

詳細
有効化条件必須デフォルト値の制限説明
dailyTransactionHistoryIdstring
~ 1024文字日々の取引履歴 GRN
※ サーバーが自動で設定
yearint
2000 ~ 3000
monthint
1 ~ 12
dayint
1 ~ 31
currencystring
~ 8文字通貨コード
depositAmountdouble00 ~ 281474976710654売り上げ総額
この日に入金された実金額(売上)の合計で、指定された通貨建てです。
withdrawAmountdouble00 ~ 281474976710654消費総額
この日に消費(出金)された通貨の実金額換算の合計で、消費された各入金トランザクションの単価から算出されます。
issueCountlong00 ~ 9223372036854775805発行数量
この日に入金(発行)された仮想通貨の総単位数で、有償通貨と無償通貨の両方を含みます。
consumeCountlong00 ~ 9223372036854775805消費数量
この日に消費(出金)された仮想通貨の総単位数です。
updatedAtlong
現在時刻最終更新日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

UnusedBalance

未使用残高

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

詳細
有効化条件必須デフォルト値の制限説明
unusedBalanceIdstring
~ 1024文字未使用残高 GRN
※ サーバーが自動で設定
currencystring
~ 8文字通貨コード
未使用残高が追跡されるISO通貨コード(例:“JPY”、“USD”)です。
balancedouble
0 ~ 16777214未使用残高
全ユーザーにわたる有償通貨の未使用総額で、指定された通貨建てです。資金決済法およびそれに類する規制への準拠に使用されます。
updatedAtlong
現在時刻最終更新日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

StoreContentModel

ストアコンテンツモデル

各種ストアプラットフォームのコンテンツを格納するモデルです。

詳細
有効化条件必須デフォルト値の制限説明
storeContentModelIdstring
~ 1024文字ストアコンテンツモデル GRN
※ サーバーが自動で設定
namestring
~ 128文字ストアコンテンツモデル名
metadatastring~ 1024文字メタデータ
メタデータには任意の値を設定できます。
これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。
appleAppStoreAppleAppStoreContentApple AppStore のコンテンツ
このストアコンテンツの Apple App Store 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。
googlePlayGooglePlayContentGoogle Play のコンテンツ
このストアコンテンツの Google Play 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。

StoreSubscriptionContentModel

ストア定期課金コンテンツモデル

各種ストアプラットフォームの定期課金コンテンツを格納するモデルです。

詳細
有効化条件必須デフォルト値の制限説明
storeSubscriptionContentModelIdstring
~ 1024文字期間課金コンテンツモデル GRN
※ サーバーが自動で設定
namestring
~ 128文字ストア定期課金コンテンツモデル名
metadatastring~ 1024文字メタデータ
scheduleNamespaceIdstring
~ 1024文字サブスクリプション期間を連動させる GS2-Schedule のネームスペース GRN
triggerNamestring
~ 128文字サブスクリプション期間を反映するトリガー名
サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。
triggerExtendMode文字列列挙型
enum {
  “just”,
  “rollupHour”
}
“just”サブスクリプション期間をトリガーに反映する時のモード
サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。“just” はサブスクリプション期間をそのまま使用します。“rollupHour” は指定した時刻(UTC)まで延長し、日中の期限切れを回避します。
定義説明
“just”そのままサブスクリプション期間を反映
“rollupHour”次の日跨ぎ時刻まで延長してサブスクリプション期間を反映
rollupHourint{triggerExtendMode} == “rollupHour”00 ~ 23日跨ぎの時刻 (UTC)
triggerExtendMode が “rollupHour” の場合、サブスクリプション期間は有効期限日のこの時刻(0〜23、UTC)まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。
※ triggerExtendMode が “rollupHour” であれば 有効
reallocateSpanDaysint300 ~ 365サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間(日)
最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。
appleAppStoreAppleAppStoreSubscriptionContentApple AppStore のコンテンツ
このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報(サブスクリプショングループID)です。
googlePlayGooglePlaySubscriptionContentGoogle Play のコンテンツ
このサブスクリプションコンテンツの Google Play のサブスクリプション情報(プロダクトID)です。

Receipt

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

ストアプラットフォーム(Apple App Store、Google Play、またはテスト用Fake)からの購入レシートを表します。サーバーサイドのレシート検証に必要なトランザクションIDとペイロードデータを含みます。

詳細
有効化条件必須デフォルト値の制限説明
Store文字列列挙型
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
ストア
購入が行われたストアプラットフォームです。レシート検証に使用される検証方法を決定します。
定義説明
“AppleAppStore”Apple App Store
“GooglePlay”Google Play
“fake”Fake
TransactionIDstring
~ 1024文字トランザクションID
ストアプラットフォームによって割り当てられた一意のトランザクション識別子です。同一購入の重複処理を防止するために使用されます。
Payloadstring
~ 1048576文字ペイロード
ストアプラットフォームからのレシートデータです。フォーマットはプラットフォームによって異なります。Apple App Store の場合はトランザクションレシート、Google Play の場合は購入トークンと関連データです。

PlatformSetting

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

サポートされている全ストアプラットフォームの設定を集約します。Apple App Store、Google Play、Fake(Unity Editorでのテスト用)の設定を含みます。各プラットフォーム設定にはレシート検証に必要な認証情報やキーが含まれます。

詳細
有効化条件必須デフォルト値の制限説明
appleAppStoreAppleAppStoreSettingApple AppStore の設定
Apple App Store のレシート検証に使用する認証情報です。バンドルID、共有秘密鍵、Issuer ID、キーID、秘密鍵を含みます。
googlePlayGooglePlaySettingGoogle Play の設定
Google Play のレシート検証に使用する認証情報です。パッケージ名と署名検証用の公開鍵を含みます。
fakeFakeSettingFake (Unity Editor) の設定
開発・テスト中に Unity Editor が生成するフェイクレシートの受け入れに関する設定です。

AppleAppStoreSetting

Apple AppStore の設定

Apple App Store のレシート検証のための設定です。Apple のレシート検証サーバーとの通信に必要な認証情報を含みます。バンドルID、共有秘密鍵、App Store Connect の Issuer ID、キーID、秘密鍵が含まれます。

詳細
有効化条件必須デフォルト値の制限説明
bundleIdstring~ 1024文字Apple AppStore のバンドルID
sharedSecretKeystring~ 1024文字AppStore Connect で発行したレシートの暗号化に使用する共有秘密鍵
issuerIdstring~ 1024文字AppStore Connect で登録したアプリ内課金の Issuer ID
keyIdstring~ 1024文字Apple に登録済みのキーID
privateKeyPemstring~ 10240文字Apple から受け取った秘密鍵

GooglePlaySetting

Google Play の設定

Google Play のレシート検証のための設定です。Google Play からの購入署名を検証するために必要なパッケージ名と公開鍵を含みます。

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

FakeSetting

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

開発中に Unity Editor が生成するフェイクレシートの処理に関する設定です。フェイクレシートを受け入れるか拒否するかを制御し、実際のストアプラットフォームを使わずにアプリ内課金フローをテストできるようにします。

詳細
有効化条件必須デフォルト値の制限説明
acceptFakeReceipt文字列列挙型
enum {
  “Accept”,
  “Reject”
}
“Reject”Unity Editor が出力する偽のレシートで決済できるようにするか
フェイクレシートの受け入れを制御します。開発・テスト中は “Accept” に設定し、本番環境では不正な通貨入金を防ぐために “Reject” に設定してください。
定義説明
“Accept”受け入れる
“Reject”拒否する

WalletSummary

ウォレットの状態

ウォレットの通貨残高のサマリービューで、有償と無償の金額を分離しています。ウォレット内のすべての入金トランザクションを価格に基づいて集計して算出されます(価格 > 0 は有償、価格 = 0 は無償)。

詳細
有効化条件必須デフォルト値の制限説明
paidint00 ~ 2147483646有償通貨
実際のお金で購入された通貨の合計量です(価格 > 0 の入金トランザクション)。
freeint00 ~ 2147483646無償通貨
無償で入手した通貨の合計量です(価格 = 0 の入金トランザクション)。ログインボーナスやイベント報酬などが含まれます。
totalint00 ~ 2147483646総数
通貨残高の合計(有償 + 無償)。ウォレットで利用可能な全体量を表します。

DepositTransaction

入金トランザクション

ウォレット内の単一の入金レコードを表します。有償の入金(価格 > 0)は正確な返金計算と資金決済法への準拠のために単価ごとに追跡されます。無償の入金(価格 = 0)は別途追跡されます。出金時には、ネームスペースの通貨消費優先度に基づいて入金トランザクションが消費されます。

詳細
有効化条件必須デフォルト値の制限説明
pricedouble
0.0 ~ 100000000.0購入価格
この入金に対して現地通貨で支払われた実際の金額です。0 は無償通貨を示します。返金目的の単価計算に使用されます。
currencystring{price} > 0
✓※
~ 8文字通貨コード
実際の支払いのISO通貨コード(例:“JPY”、“USD”)です。有償の入金(価格 > 0)の場合のみ適用されます。
※ price が 0 より大きければ 必須
countint
0 ~ 2147483646課金通貨の数量
この入金における仮想通貨の単位数です。ウォレットから出金されると減少します。
depositedAtlong入金日時
この入金が行われた日時です。

VerifyReceiptEvent

レシート検証イベント

ストアのレシート検証の詳細を記録します。検証されたストアコンテンツ、使用されたプラットフォーム、プラットフォーム固有の検証結果を含みます。

詳細
有効化条件必須デフォルト値の制限説明
contentNamestring
~ 128文字ストアコンテンツモデル名
platform文字列列挙型
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
ストアプラットフォーム
レシートが発行されたストアプラットフォームです。どの検証フローが使用されたかを決定します。
定義説明
“AppleAppStore”Apple AppStore
“GooglePlay”Google Play
“fake”Fake
appleAppStoreVerifyReceiptEventAppleAppStoreVerifyReceiptEventApple AppStore のレシート検証イベント
Apple App Store からの検証結果です。環境(sandbox または production)情報を含みます。platform が “AppleAppStore” の場合に設定されます。
googlePlayVerifyReceiptEventGooglePlayVerifyReceiptEventGoogle Play のレシート検証イベント
Google Play からの検証結果です。購入トークンを含みます。platform が “GooglePlay” の場合に設定されます。

DepositEvent

入金イベント

ウォレットへの通貨入金の詳細を記録します。入金トランザクションと入金後のウォレットの状態を含みます。

詳細
有効化条件必須デフォルト値の制限説明
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。
depositTransactionsList<DepositTransaction>[]0 ~ 1000 items入金トランザクションリスト
このイベントでウォレットに追加された入金トランザクションです。
statusWalletSummary
ウォレットの状態
入金が適用された後のウォレットの残高サマリー(有償、無償、合計)です。

WithdrawEvent

出金イベント

ウォレットからの通貨出金の詳細を記録します。消費された入金トランザクションの内訳と出金後のウォレットの状態を含みます。

詳細
有効化条件必須デフォルト値の制限説明
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。
withdrawDetailsList<DepositTransaction>[]0 ~ 1000 items出金したウォレットの詳細リスト
通貨が消費された入金トランザクションの内訳です。どの入金(有償か無償か、どの単価のもの)から引き落とされたかを示します。
statusWalletSummary
ウォレットの状態
出金が適用された後のウォレットの残高サマリー(有償、無償、合計)です。

RefundEvent

返金イベント

返金イベントの詳細を記録します。返金されたストアコンテンツ、返金が処理されたプラットフォーム、プラットフォーム固有の返金情報を含みます。

詳細
有効化条件必須デフォルト値の制限説明
contentNamestring
~ 128文字ストアコンテンツモデル名
platform文字列列挙型
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
ストアプラットフォーム
返金が発行されたストアプラットフォームです。
定義説明
“AppleAppStore”Apple AppStore
“GooglePlay”Google Play
“fake”Fake
appleAppStoreRefundEventAppleAppStoreVerifyReceiptEventApple AppStore のレシート検証イベント
googlePlayRefundEventGooglePlayVerifyReceiptEventGoogle Play のレシート検証イベント

AppleAppStoreVerifyReceiptEvent

Apple AppStore のレシート

Apple App Store のレシート検証の結果を含みます。購入が行われた環境(sandbox または production)の情報を含みます。

詳細
有効化条件必須デフォルト値の制限説明
environment文字列列挙型
enum {
  “sandbox”,
  “production”
}
環境
レシートが生成された Apple App Store の環境です。“sandbox” はテスト購入を、“production” は実際の購入を示します。
定義説明
“sandbox”Sandbox
“production”Production

GooglePlayVerifyReceiptEvent

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

Google Play のレシート検証の結果を含みます。購入の検証に使用された購入トークンを含みます。

詳細
有効化条件必須デフォルト値の制限説明
purchaseTokenstring~ 4096文字Purchase Token
購入成功後に Google Play から返される購入トークンです。Google Play のサーバーでの購入の検証と確認に使用されます。

AppleAppStoreContent

Apple AppStore のコンテンツ

アプリ内課金商品に対応する Apple App Store のプロダクトIDを含みます。レシート検証時の照合に使用されます。

詳細
有効化条件必須デフォルト値の制限説明
productIdstring~ 1024文字プロダクトID
このアプリ内課金アイテムについて App Store Connect に登録されている Apple App Store のプロダクト識別子です。

GooglePlayContent

Google Play のコンテンツ

アプリ内課金商品に対応する Google Play のプロダクトIDを含みます。レシート検証時の照合に使用されます。

詳細
有効化条件必須デフォルト値の制限説明
productIdstring~ 1024文字プロダクトID
このアプリ内課金アイテムについて Google Play Console に登録されている Google Play のプロダクト識別子です。

AppleAppStoreSubscriptionContent

Apple AppStore の期間課金コンテンツ

サブスクリプションベースの商品の Apple App Store サブスクリプショングループ識別子を含みます。自動更新サブスクリプションの管理と検証に使用されます。

詳細
有効化条件必須デフォルト値の制限説明
subscriptionGroupIdentifierstring~ 64文字サブスクリプショングループID
App Store Connect に登録されたサブスクリプショングループ識別子です。同じグループ内のサブスクリプションは相互排他的で、ユーザーは同時に1つしか契約できません。

GooglePlaySubscriptionContent

Google Play の期間課金コンテンツ

サブスクリプションベースの商品の Google Play プロダクトIDを含みます。Google Play での自動更新サブスクリプションの管理と検証に使用されます。

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

GooglePlayRealtimeNotificationMessage

RTDN メッセージ

Google Play のリアルタイム開発者通知(RTDN)メッセージを表します。RTDN メッセージは Google Play からサーバーに送信され、サブスクリプション状態の変化(更新、解約、期限切れなど)を通知します。

詳細
有効化条件必須デフォルト値の制限説明
datastring
~ 1048576文字データ
Google Play からのサブスクリプション状態変更情報を含むBase64エンコードされた通知ペイロードです。
messageIdstring
~ 1024文字メッセージID
この RTDN メッセージの一意の識別子です。重複排除に使用されます。
publishTimestring
~ 1024文字通知が送信された日時
Google Cloud Pub/Sub によって通知が送信された日時で、RFC 3339 形式です。

CurrentModelMaster

現在アクティブなモデルのマスターデータ

現在ネームスペース内で有効なモデルの定義を記述したマスターデータです。
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。

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

詳細
有効化条件必須デフォルト値の制限説明
namespaceIdstring
~ 1024文字ネームスペース GRN
※ サーバーが自動で設定
settingsstring
~ 5242880 バイト (5MB)マスターデータ

StoreContentModelMaster

ストアコンテンツモデルマスター

ストアコンテンツモデルは、各種ストアプラットフォームのコンテンツを格納するモデルです。

詳細
有効化条件必須デフォルト値の制限説明
storeContentModelIdstring
~ 1024文字コンテンツモデルマスター GRN
※ サーバーが自動で設定
namestring
~ 128文字ストアコンテンツモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
appleAppStoreAppleAppStoreContentApple AppStore のコンテンツ
このストアコンテンツの Apple App Store 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。
googlePlayGooglePlayContentGoogle Play のコンテンツ
このストアコンテンツの Google Play 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。
createdAtlong
現在時刻作成日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
updatedAtlong
現在時刻最終更新日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

StoreSubscriptionContentModelMaster

ストア定期課金コンテンツモデルマスター

各種ストアプラットフォームの定期課金コンテンツを格納するモデルです。

詳細
有効化条件必須デフォルト値の制限説明
storeSubscriptionContentModelIdstring
~ 1024文字期間課金コンテンツモデルマスター GRN
※ サーバーが自動で設定
namestring
~ 128文字ストア定期課金コンテンツモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
scheduleNamespaceIdstring
~ 1024文字サブスクリプション期間を連動させる GS2-Schedule のネームスペース GRN
triggerNamestring
~ 128文字サブスクリプション期間を反映するトリガー名
サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。
reallocateSpanDaysint300 ~ 365サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間(日)
最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。
triggerExtendMode文字列列挙型
enum {
  “just”,
  “rollupHour”
}
“just”サブスクリプション期間をトリガーに反映する時のモード
サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。“just” はサブスクリプション期間をそのまま使用します。“rollupHour” は指定した時刻(UTC)まで延長し、日中の期限切れを回避します。
定義説明
“just”そのままサブスクリプション期間を反映
“rollupHour”次の日跨ぎ時刻まで延長してサブスクリプション期間を反映
rollupHourint{triggerExtendMode} == “rollupHour”00 ~ 23日跨ぎの時刻 (UTC)
triggerExtendMode が “rollupHour” の場合、サブスクリプション期間は有効期限日のこの時刻(0〜23、UTC)まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。
※ triggerExtendMode が “rollupHour” であれば 有効
appleAppStoreAppleAppStoreSubscriptionContentApple AppStore のコンテンツ
このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報(サブスクリプショングループID)です。
googlePlayGooglePlaySubscriptionContentGoogle Play のコンテンツ
このサブスクリプションコンテンツの Google Play のサブスクリプション情報(プロダクトID)です。
createdAtlong
現在時刻作成日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
updatedAtlong
現在時刻最終更新日時
UNIX 時間・ミリ秒
※ サーバーが自動で設定
revisionlong00 ~ 9223372036854775805リビジョン

メソッド

describeNamespaces

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

プロジェクト内において、サービス単位で作成されたネームスペースの一覧を取得します。
オプションのページトークンを使用して、リストの特定の位置からデータの取得を開始できます。
また、取得するネームスペースの数を制限することも可能です。

詳細

Request

有効化条件必須デフォルト値の制限説明
namePrefixstring~ 64文字ネームスペース名のフィルター接頭辞
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 {
        NamePrefix: nil,
        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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->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()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Money2.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .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()
            .withNamePrefix(null)
            .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_name_prefix(None)
            .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({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

createNamespace

ネームスペースを新規作成

ネームスペースの名前、説明、および各種設定を含む詳細情報を指定する必要があります。

詳細

Request

有効化条件必須デフォルト値の制限説明
namestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
currencyUsagePriority文字列列挙型
enum {
  “PrioritizeFree”,
  “PrioritizePaid”
}
消費優先度
ウォレットから出金する際に有償通貨と無償通貨のどちらを先に消費するかを決定します。“PrioritizeFree” は無償通貨を優先し、“PrioritizePaid” は有償通貨を優先します。
定義説明
“PrioritizeFree”無償通貨を優先して使用する
“PrioritizePaid”有償通貨を優先して使用する
descriptionstring~ 1024文字説明文
transactionSettingTransactionSettingトランザクション設定
通貨の入金・出金時に使用される分散トランザクションの設定です。
sharedFreeCurrencybool
無償通貨を異なるスロットで共有するか
有効にすると、無償通貨の残高がすべてのウォレットスロット(プラットフォーム)間で共有されます。有償通貨はスロットごとに分離されたままです。この設定はネームスペース作成時のみ設定可能で、後から変更できません。
platformSettingPlatformSetting
ストアプラットフォーム設定
サポートされている各ストアプラットフォーム(Apple App Store、Google Play、テスト用Fake)の設定です。各プラットフォームでのレシート検証に必要な認証情報やキーを含みます。
depositBalanceScriptScriptSettingウォレット残高を加算したときに実行するスクリプトの設定
Script トリガーリファレンス - deposit
withdrawBalanceScriptScriptSettingウォレット残高を消費したときに実行するスクリプトの設定
Script トリガーリファレンス - withdraw
verifyReceiptScriptScriptSettingレシート検証を実行したときに実行するスクリプトの設定
Script トリガーリファレンス - verifyReceipt
subscribeScriptstring~ 1024文字期間課金を新規契約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない/一度契約失効後に再度契約した場合も呼び出される)
Script トリガーリファレンス - subscribe
renewScriptstring~ 1024文字期間課金を更新するときに実行する GS2-Script スクリプトGRN
Script トリガーリファレンス - renew
unsubscribeScriptstring~ 1024文字期間課金を解約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない)
Script トリガーリファレンス - unsubscribe
takeOverScriptScriptSetting期間課金に紐づけられたユーザーを変更するときに実行するスクリプトの設定
Script トリガーリファレンス - takeOver
changeSubscriptionStatusNotificationNotificationSetting期間課金の契約状況が変化したときのプッシュ通知
サブスクリプションのステータスが変化した際(有効化、更新、解約、期限切れ、取り消しなど)に GS2-Gateway を通じて配信されるプッシュ通知の設定です。ゲームクライアントがサブスクリプション状態の変化にリアルタイムで対応できるようにします。
logSettingLogSettingログの出力設定
このネームスペースに対するAPIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。入金、出金、レシート検証、サブスクリプションイベントの追跡に役立ちます。

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("namespace-0001"),
        CurrencyUsagePriority: pointy.String("PrioritizeFree"),
        Description: nil,
        TransactionSetting: nil,
        SharedFreeCurrency: pointy.Bool(false),
        PlatformSetting: nil,
        DepositBalanceScript: nil,
        WithdrawBalanceScript: nil,
        VerifyReceiptScript: nil,
        SubscribeScript: nil,
        RenewScript: nil,
        UnsubscribeScript: nil,
        TakeOverScript: nil,
        ChangeSubscriptionStatusNotification: nil,
        LogSetting: &money2.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withCurrencyUsagePriority("PrioritizeFree")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withSharedFreeCurrency(False)
            ->withPlatformSetting(null)
            ->withDepositBalanceScript(null)
            ->withWithdrawBalanceScript(null)
            ->withVerifyReceiptScript(null)
            ->withSubscribeScript(null)
            ->withRenewScript(null)
            ->withUnsubscribeScript(null)
            ->withTakeOverScript(null)
            ->withChangeSubscriptionStatusNotification(null)
            ->withLogSetting((new \Gs2\Money2\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.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("namespace-0001")
            .withCurrencyUsagePriority("PrioritizeFree")
            .withDescription(null)
            .withTransactionSetting(null)
            .withSharedFreeCurrency(false)
            .withPlatformSetting(null)
            .withDepositBalanceScript(null)
            .withWithdrawBalanceScript(null)
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new io.gs2.money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Money2.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithCurrencyUsagePriority("PrioritizeFree")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithSharedFreeCurrency(false)
        .WithPlatformSetting(null)
        .WithDepositBalanceScript(null)
        .WithWithdrawBalanceScript(null)
        .WithVerifyReceiptScript(null)
        .WithSubscribeScript(null)
        .WithRenewScript(null)
        .WithUnsubscribeScript(null)
        .WithTakeOverScript(null)
        .WithChangeSubscriptionStatusNotification(null)
        .WithLogSetting(new Gs2.Gs2Money2.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.createNamespace(
        new Gs2Money2.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withCurrencyUsagePriority("PrioritizeFree")
            .withDescription(null)
            .withTransactionSetting(null)
            .withSharedFreeCurrency(false)
            .withPlatformSetting(null)
            .withDepositBalanceScript(null)
            .withWithdrawBalanceScript(null)
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new Gs2Money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.create_namespace(
        money2.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_currency_usage_priority('PrioritizeFree')
            .with_description(None)
            .with_transaction_setting(None)
            .with_shared_free_currency(False)
            .with_platform_setting(None)
            .with_deposit_balance_script(None)
            .with_withdraw_balance_script(None)
            .with_verify_receipt_script(None)
            .with_subscribe_script(None)
            .with_renew_script(None)
            .with_unsubscribe_script(None)
            .with_take_over_script(None)
            .with_change_subscription_status_notification(None)
            .with_log_setting(
                money2.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.create_namespace({
    name="namespace-0001",
    currencyUsagePriority="PrioritizeFree",
    description=nil,
    transactionSetting=nil,
    sharedFreeCurrency=false,
    platformSetting=nil,
    depositBalanceScript=nil,
    withdrawBalanceScript=nil,
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    currencyUsagePriority="PrioritizeFree",
    description=nil,
    transactionSetting=nil,
    sharedFreeCurrency=false,
    platformSetting=nil,
    depositBalanceScript=nil,
    withdrawBalanceScript=nil,
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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("namespace-0001"),
    }
)
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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $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("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Money2.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    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("namespace-0001")
    );
    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('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})

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

result = api_result.result
status = result.status;
client = gs2('money2')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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("namespace-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\GetNamespaceRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-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.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Money2.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-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.getNamespace(
        new Gs2Money2.GetNamespaceRequest()
            .withNamespaceName("namespace-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.get_namespace(
        money2.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_namespace({
    namespaceName="namespace-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateNamespace

ネームスペースを更新

指定されたネームスペースの設定を更新します。
ネームスペースの説明や、特定の設定を変更することができます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
currencyUsagePriority文字列列挙型
enum {
  “PrioritizeFree”,
  “PrioritizePaid”
}
消費優先度
ウォレットから出金する際に有償通貨と無償通貨のどちらを先に消費するかを決定します。“PrioritizeFree” は無償通貨を優先し、“PrioritizePaid” は有償通貨を優先します。
定義説明
“PrioritizeFree”無償通貨を優先して使用する
“PrioritizePaid”有償通貨を優先して使用する
descriptionstring~ 1024文字説明文
transactionSettingTransactionSettingトランザクション設定
通貨の入金・出金時に使用される分散トランザクションの設定です。
platformSettingPlatformSetting
ストアプラットフォーム設定
サポートされている各ストアプラットフォーム(Apple App Store、Google Play、テスト用Fake)の設定です。各プラットフォームでのレシート検証に必要な認証情報やキーを含みます。
depositBalanceScriptScriptSettingウォレット残高を加算したときに実行するスクリプトの設定
Script トリガーリファレンス - deposit
withdrawBalanceScriptScriptSettingウォレット残高を消費したときに実行するスクリプトの設定
Script トリガーリファレンス - withdraw
verifyReceiptScriptScriptSettingレシート検証を実行したときに実行するスクリプトの設定
Script トリガーリファレンス - verifyReceipt
subscribeScriptstring~ 1024文字期間課金を新規契約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない/一度契約失効後に再度契約した場合も呼び出される)
Script トリガーリファレンス - subscribe
renewScriptstring~ 1024文字期間課金を更新するときに実行する GS2-Script スクリプトGRN
Script トリガーリファレンス - renew
unsubscribeScriptstring~ 1024文字期間課金を解約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない)
Script トリガーリファレンス - unsubscribe
takeOverScriptScriptSetting期間課金に紐づけられたユーザーを変更するときに実行するスクリプトの設定
Script トリガーリファレンス - takeOver
changeSubscriptionStatusNotificationNotificationSetting期間課金の契約状況が変化したときのプッシュ通知
サブスクリプションのステータスが変化した際(有効化、更新、解約、期限切れ、取り消しなど)に GS2-Gateway を通じて配信されるプッシュ通知の設定です。ゲームクライアントがサブスクリプション状態の変化にリアルタイムで対応できるようにします。
logSettingLogSettingログの出力設定
このネームスペースに対するAPIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。入金、出金、レシート検証、サブスクリプションイベントの追跡に役立ちます。

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("namespace-0001"),
        CurrencyUsagePriority: pointy.String("PrioritizePaid"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        PlatformSetting: &money2.PlatformSetting{
        },
        DepositBalanceScript: &money2.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"),
        },
        WithdrawBalanceScript: &money2.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"),
        },
        VerifyReceiptScript: nil,
        SubscribeScript: nil,
        RenewScript: nil,
        UnsubscribeScript: nil,
        TakeOverScript: nil,
        ChangeSubscriptionStatusNotification: nil,
        LogSetting: &money2.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withCurrencyUsagePriority("PrioritizePaid")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withPlatformSetting((new \Gs2\Money2\Model\PlatformSetting()))
            ->withDepositBalanceScript((new \Gs2\Money2\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
            ->withWithdrawBalanceScript((new \Gs2\Money2\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
            ->withVerifyReceiptScript(null)
            ->withSubscribeScript(null)
            ->withRenewScript(null)
            ->withUnsubscribeScript(null)
            ->withTakeOverScript(null)
            ->withChangeSubscriptionStatusNotification(null)
            ->withLogSetting((new \Gs2\Money2\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.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("namespace-0001")
            .withCurrencyUsagePriority("PrioritizePaid")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withPlatformSetting(new io.gs2.money2.model.PlatformSetting())
            .withDepositBalanceScript(new io.gs2.money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
            .withWithdrawBalanceScript(new io.gs2.money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new io.gs2.money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Money2.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithCurrencyUsagePriority("PrioritizePaid")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithPlatformSetting(new Gs2.Gs2Money2.Model.PlatformSetting())
        .WithDepositBalanceScript(new Gs2.Gs2Money2.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
        .WithWithdrawBalanceScript(new Gs2.Gs2Money2.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
        .WithVerifyReceiptScript(null)
        .WithSubscribeScript(null)
        .WithRenewScript(null)
        .WithUnsubscribeScript(null)
        .WithTakeOverScript(null)
        .WithChangeSubscriptionStatusNotification(null)
        .WithLogSetting(new Gs2.Gs2Money2.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.updateNamespace(
        new Gs2Money2.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withCurrencyUsagePriority("PrioritizePaid")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withPlatformSetting(new Gs2Money2.model.PlatformSetting())
            .withDepositBalanceScript(new Gs2Money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
            .withWithdrawBalanceScript(new Gs2Money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new Gs2Money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.update_namespace(
        money2.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_currency_usage_priority('PrioritizePaid')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_platform_setting(
                money2.PlatformSetting())
            .with_deposit_balance_script(
                money2.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004'))
            .with_withdraw_balance_script(
                money2.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006'))
            .with_verify_receipt_script(None)
            .with_subscribe_script(None)
            .with_renew_script(None)
            .with_unsubscribe_script(None)
            .with_take_over_script(None)
            .with_change_subscription_status_notification(None)
            .with_log_setting(
                money2.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    currencyUsagePriority="PrioritizePaid",
    description="description1",
    transactionSetting=nil,
    platformSetting={
    },
    depositBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004",
    },
    withdrawBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006",
    },
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    currencyUsagePriority="PrioritizePaid",
    description="description1",
    transactionSetting=nil,
    platformSetting={
    },
    depositBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004",
    },
    withdrawBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006",
    },
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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("namespace-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\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-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.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Money2.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-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.deleteNamespace(
        new Gs2Money2.DeleteNamespaceRequest()
            .withNamespaceName("namespace-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.delete_namespace(
        money2.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.delete_namespace({
    namespaceName="namespace-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getServiceVersion

マイクロサービスのバージョンを取得

詳細

Request

Request parameters: None

Result

説明
itemstringバージョン

実装例

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.GetServiceVersion(
    &money2.GetServiceVersionRequest {
    }
)
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\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $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.GetServiceVersionRequest;
import io.gs2.money2.result.GetServiceVersionResult;

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

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Money2.Request.GetServiceVersionRequest(),
    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.getServiceVersion(
        new Gs2Money2.GetServiceVersionRequest()
    );
    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_service_version(
        money2.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_service_version({
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_service_version_async({
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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 Gs2Money2RestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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 Gs2Money2RestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('money2')

api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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 Gs2Money2RestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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 Gs2Money2RestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

prepareImportUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを実行

インポートに使用できるデータは GS2 によってエクスポートして取得したデータに限定され、古いデータはインポートに失敗する可能性があります。
エクスポートしたユーザーIDと異なるユーザーIDでインポートすることができますが、ユーザーデータのペイロード内にユーザーIDが含まれる場合はその限りではありません。

このAPIの戻り値で応答されたURLにエクスポートした zip ファイルをアップロードし、importUserDataByUserId を呼び出すことで実際のインポート処理を開始できます。

詳細

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 Gs2Money2RestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('money2')

api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを実行

インポートに使用できるデータは GS2 によってエクスポートして取得したデータに限定され、古いデータはインポートに失敗する可能性があります。
エクスポートしたユーザーIDと異なるユーザーIDでインポートすることができますが、ユーザーデータのペイロード内にユーザーIDが含まれる場合はその限りではありません。

このAPIを呼び出す前に prepareImportUserDataByUserId を呼び出して、アップロード準備を完了させる必要があります。

詳細

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 Gs2Money2RestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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 Gs2Money2RestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('money2')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
url = result.url;

describeWallets

ウォレット一覧を取得

リクエストユーザーのウォレットのページネーション付きリストを取得します。
各ウォレットは、有償通貨と無償通貨が個別に管理される独立した残高を持ちます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring
~ 128文字アクセストークン
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("namespace-0001"),
        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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeWallets(
        (new DescribeWalletsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeWalletsResult> asyncResult = null;
yield return client.DescribeWallets(
    new Gs2.Gs2Money2.Request.DescribeWalletsRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-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="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_wallets_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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("namespace-0001"),
        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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeWalletsByUserId(
        (new DescribeWalletsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeWalletsByUserIdResult> asyncResult = null;
yield return client.DescribeWalletsByUserId(
    new Gs2.Gs2Money2.Request.DescribeWalletsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_wallets_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

getWallet

ウォレットを取得

リクエストユーザーの指定されたスロットのウォレットを、有償通貨および無償通貨の残高を含めて取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring
~ 128文字アクセストークン
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。

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("namespace-0001"),
        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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getWallet(
        (new GetWalletRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->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("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
    );
    Wallet item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetWalletResult> asyncResult = null;
yield return client.GetWallet(
    new Gs2.Gs2Money2.Request.GetWalletRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_slot(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

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

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_wallet_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    slot=0,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getWalletByUserId

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

指定されたユーザーの指定されたスロットのウォレットを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring
~ 128文字ユーザーID
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。
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("namespace-0001"),
        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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getWalletByUserId(
        (new GetWalletByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withTimeOffsetToken(null)
    );
    Wallet item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetWalletByUserIdResult> asyncResult = null;
yield return client.GetWalletByUserId(
    new Gs2.Gs2Money2.Request.GetWalletByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    userId="user-0001",
    slot=0,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_wallet_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

depositByUserId

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

指定されたユーザーのウォレットに指定された入金トランザクションを追加します。
各入金トランザクションに対してイベントログが記録されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring
~ 128文字ユーザーID
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。
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("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Slot: pointy.Int32(0),
        DepositTransactions: []money2.DepositTransaction{
            money2.DepositTransaction{
                Price: pointy.Float64(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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->depositByUserId(
        (new DepositByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withDepositTransactions(Arrays.asList(
                new DepositTransaction()
                    .withPrice(120)
                    .withCurrency("JPY")
                    .withCount(50)
            ))
            .withTimeOffsetToken(null)
    );
    Wallet item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DepositByUserIdResult> asyncResult = null;
yield return client.DepositByUserId(
    new Gs2.Gs2Money2.Request.DepositByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithSlot(0)
        .WithDepositTransactions(new Gs2.Gs2Money2.Model.DepositTransaction[] {
            new Gs2.Gs2Money2.Model.DepositTransaction()
                .WithPrice(120)
                .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

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

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

withdraw

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

リクエストユーザーのウォレットから指定量の通貨を消費します。
paidOnly が false の場合、無償通貨が先に消費され、次に有償通貨が消費されます。paidOnly が true の場合、有償通貨のみが消費されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring
~ 128文字アクセストークン
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。
withdrawCountint
1 ~ 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("namespace-0001"),
        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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->withdraw(
        (new WithdrawRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.WithdrawResult> asyncResult = null;
yield return client.Withdraw(
    new Gs2.Gs2Money2.Request.WithdrawRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-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="namespace-0001",
    accessToken="accessToken-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
})

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

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;
client = gs2('money2')

api_result_handler = client.withdraw_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

withdrawByUserId

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

指定されたユーザーのウォレットから指定量の通貨を消費します。
paidOnly が false の場合、無償通貨が先に消費され、次に有償通貨が消費されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring
~ 128文字ユーザーID
slotint
0 ~ 100000000スロット番号
ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます(例:iOS用とAndroid用)。
withdrawCountint
1 ~ 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("namespace-0001"),
        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 Gs2Money2RestClient(
    $session
);

try {
    $result = $client->withdrawByUserId(
        (new WithdrawByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.WithdrawByUserIdResult> asyncResult = null;
yield return client.WithdrawByUserId(
    new Gs2.Gs2Money2.Request.WithdrawByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;
client = gs2('money2')

api_result_handler = client.withdraw_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

describeEventsByUserId

イベントの一覧を取得

指定されたユーザーの購入イベントのページネーション付きリストを指定された日付範囲内で取得します。
デフォルトの日付範囲は過去30日間です。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring
~ 128文字ユーザーID
beginlong現在時刻から30日前の絶対時刻検索開始日時
endlong現在時刻検索終了日時
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<Event>イベントのリスト
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.DescribeEventsByUserId(
    &money2.DescribeEventsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Begin: nil,
        End: nil,
        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\DescribeEventsByUserIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeEventsByUserId(
        (new DescribeEventsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withBegin(null)
            ->withEnd(null)
            ->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.DescribeEventsByUserIdRequest;
import io.gs2.money2.result.DescribeEventsByUserIdResult;

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

try {
    DescribeEventsByUserIdResult result = client.describeEventsByUserId(
        new DescribeEventsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withBegin(null)
            .withEnd(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Event> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeEventsByUserIdResult> asyncResult = null;
yield return client.DescribeEventsByUserId(
    new Gs2.Gs2Money2.Request.DescribeEventsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithBegin(null)
        .WithEnd(null)
        .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.describeEventsByUserId(
        new Gs2Money2.DescribeEventsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withBegin(null)
            .withEnd(null)
            .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_events_by_user_id(
        money2.DescribeEventsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_begin(None)
            .with_end(None)
            .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_events_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    begin=nil,
    end=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_events_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    begin=nil,
    end=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

getEventByTransactionId

トランザクションIDを指定してイベントを取得

トランザクションIDで特定の購入イベントを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
transactionIdstring
~ 1024文字トランザクションID
この決済イベントの一意の識別子です。レシート検証イベントの場合はストアプラットフォームのトランザクションIDに対応します。

Result

説明
itemEventイベント

実装例

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.GetEventByTransactionId(
    &money2.GetEventByTransactionIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        TransactionId: pointy.String("transaction-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\GetEventByTransactionIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getEventByTransactionId(
        (new GetEventByTransactionIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withTransactionId("transaction-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.GetEventByTransactionIdRequest;
import io.gs2.money2.result.GetEventByTransactionIdResult;

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

try {
    GetEventByTransactionIdResult result = client.getEventByTransactionId(
        new GetEventByTransactionIdRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-0001")
    );
    Event item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetEventByTransactionIdResult> asyncResult = null;
yield return client.GetEventByTransactionId(
    new Gs2.Gs2Money2.Request.GetEventByTransactionIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithTransactionId("transaction-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.getEventByTransactionId(
        new Gs2Money2.GetEventByTransactionIdRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-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.get_event_by_transaction_id(
        money2.GetEventByTransactionIdRequest()
            .with_namespace_name('namespace-0001')
            .with_transaction_id('transaction-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_event_by_transaction_id({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_event_by_transaction_id_async({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

verifyReceipt

レシートを使用済み化

ストアコンテンツモデルに対して購入レシートを検証し、使用済みとして記録します。
イベントログが記録され、ネームスペースに設定されたレシート検証スクリプトが実行されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring
~ 128文字アクセストークン
contentNamestring
~ 128文字ストアコンテンツモデル名
receiptReceipt
レシート

Result

説明
itemEventイベント

実装例

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.VerifyReceipt(
    &money2.VerifyReceiptRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ContentName: pointy.String("content-0001"),
        Receipt: &money2.Receipt{
            Store: pointy.String("AppleAppStore"),
            TransactionID: pointy.String("transaction-0001"),
            Payload: pointy.String("payload"),
        },
    }
)
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\VerifyReceiptRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->verifyReceipt(
        (new VerifyReceiptRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withContentName("content-0001")
            ->withReceipt((new Receipt())
                ->withStore("AppleAppStore")
                ->withTransactionID("transaction-0001")
                ->withPayload("payload")
            )
    );
    $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.VerifyReceiptRequest;
import io.gs2.money2.result.VerifyReceiptResult;

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

try {
    VerifyReceiptResult result = client.verifyReceipt(
        new VerifyReceiptRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-0001")
            .withReceipt(new Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
    );
    Event item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.VerifyReceiptResult> asyncResult = null;
yield return client.VerifyReceipt(
    new Gs2.Gs2Money2.Request.VerifyReceiptRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithContentName("content-0001")
        .WithReceipt(new Gs2.Gs2Money2.Model.Receipt()
            .WithStore("AppleAppStore")
            .WithTransactionID("transaction-0001")
            .WithPayload("payload")
        ),
    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.verifyReceipt(
        new Gs2Money2.VerifyReceiptRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-0001")
            .withReceipt(new Gs2Money2.model.Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
    );
    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.verify_receipt(
        money2.VerifyReceiptRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_content_name('content-0001')
            .with_receipt(money2.Receipt()
                .with_store('AppleAppStore')
                .with_transaction_i_d('transaction-0001')
                .with_payload('payload')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.verify_receipt({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.verify_receipt_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

verifyReceiptByUserId

ユーザーIDを指定してレシートを使用済み化

指定されたユーザーの購入レシートを検証し、使用済みとして記録します。
イベントログが記録され、ネームスペースに設定されたレシート検証スクリプトが実行されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring
~ 128文字ユーザーID
contentNamestring
~ 128文字ストアコンテンツモデル名
receiptReceipt
レシート
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemEventイベント

実装例

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.VerifyReceiptByUserId(
    &money2.VerifyReceiptByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ContentName: pointy.String("content-0001"),
        Receipt: &money2.Receipt{
            Store: pointy.String("AppleAppStore"),
            TransactionID: pointy.String("transaction-0001"),
            Payload: pointy.String("payload"),
        },
        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\VerifyReceiptByUserIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->verifyReceiptByUserId(
        (new VerifyReceiptByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withContentName("content-0001")
            ->withReceipt((new Receipt())
                ->withStore("AppleAppStore")
                ->withTransactionID("transaction-0001")
                ->withPayload("payload")
            )
            ->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.VerifyReceiptByUserIdRequest;
import io.gs2.money2.result.VerifyReceiptByUserIdResult;

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

try {
    VerifyReceiptByUserIdResult result = client.verifyReceiptByUserId(
        new VerifyReceiptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .withReceipt(new Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
            .withTimeOffsetToken(null)
    );
    Event item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.VerifyReceiptByUserIdResult> asyncResult = null;
yield return client.VerifyReceiptByUserId(
    new Gs2.Gs2Money2.Request.VerifyReceiptByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithContentName("content-0001")
        .WithReceipt(new Gs2.Gs2Money2.Model.Receipt()
            .WithStore("AppleAppStore")
            .WithTransactionID("transaction-0001")
            .WithPayload("payload")
        )
        .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.verifyReceiptByUserId(
        new Gs2Money2.VerifyReceiptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .withReceipt(new Gs2Money2.model.Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
            .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.verify_receipt_by_user_id(
        money2.VerifyReceiptByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_content_name('content-0001')
            .with_receipt(money2.Receipt()
                .with_store('AppleAppStore')
                .with_transaction_i_d('transaction-0001')
                .with_payload('payload')
            )
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.verify_receipt_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.verify_receipt_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeSubscriptionStatuses

サブスクリプションの契約状況の一覧を取得

リクエストユーザーの全てのサブスクリプションコンテンツモデルの契約状況を取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring~ 128文字アクセストークン

Result

説明
itemsList<SubscriptionStatus>サブスクリプションの契約状況のリスト

実装例

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.DescribeSubscriptionStatuses(
    &money2.DescribeSubscriptionStatusesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeSubscriptionStatusesRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeSubscriptionStatuses(
        (new DescribeSubscriptionStatusesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeSubscriptionStatusesRequest;
import io.gs2.money2.result.DescribeSubscriptionStatusesResult;

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

try {
    DescribeSubscriptionStatusesResult result = client.describeSubscriptionStatuses(
        new DescribeSubscriptionStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    List<SubscriptionStatus> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeSubscriptionStatusesResult> asyncResult = null;
yield return client.DescribeSubscriptionStatuses(
    new Gs2.Gs2Money2.Request.DescribeSubscriptionStatusesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeSubscriptionStatuses(
        new Gs2Money2.DescribeSubscriptionStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    const items = result.getItems();
} 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_subscription_statuses(
        money2.DescribeSubscriptionStatusesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_subscription_statuses({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_subscription_statuses_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

describeSubscriptionStatusesByUserId

ユーザーIDを指定してサブスクリプションの契約状況の一覧を取得

指定されたユーザーの全てのサブスクリプションコンテンツモデルの契約状況を取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<SubscriptionStatus>サブスクリプションの契約状況のリスト

実装例

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.DescribeSubscriptionStatusesByUserId(
    &money2.DescribeSubscriptionStatusesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeSubscriptionStatusesByUserIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeSubscriptionStatusesByUserId(
        (new DescribeSubscriptionStatusesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeSubscriptionStatusesByUserIdRequest;
import io.gs2.money2.result.DescribeSubscriptionStatusesByUserIdResult;

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

try {
    DescribeSubscriptionStatusesByUserIdResult result = client.describeSubscriptionStatusesByUserId(
        new DescribeSubscriptionStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    List<SubscriptionStatus> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeSubscriptionStatusesByUserIdResult> asyncResult = null;
yield return client.DescribeSubscriptionStatusesByUserId(
    new Gs2.Gs2Money2.Request.DescribeSubscriptionStatusesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeSubscriptionStatusesByUserId(
        new Gs2Money2.DescribeSubscriptionStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} 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_subscription_statuses_by_user_id(
        money2.DescribeSubscriptionStatusesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_subscription_statuses_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_subscription_statuses_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getSubscriptionStatus

サブスクリプションの契約状況を取得

リクエストユーザーの指定されたコンテンツのサブスクリプション契約状況を取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring~ 128文字アクセストークン
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名

Result

説明
itemSubscriptionStatusサブスクリプションの契約状況

実装例

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.GetSubscriptionStatus(
    &money2.GetSubscriptionStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ContentName: pointy.String("content-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\GetSubscriptionStatusRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getSubscriptionStatus(
        (new GetSubscriptionStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withContentName("content-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.GetSubscriptionStatusRequest;
import io.gs2.money2.result.GetSubscriptionStatusResult;

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

try {
    GetSubscriptionStatusResult result = client.getSubscriptionStatus(
        new GetSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-0001")
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetSubscriptionStatusResult> asyncResult = null;
yield return client.GetSubscriptionStatus(
    new Gs2.Gs2Money2.Request.GetSubscriptionStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithContentName("content-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.getSubscriptionStatus(
        new Gs2Money2.GetSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-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.get_subscription_status(
        money2.GetSubscriptionStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_subscription_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_subscription_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getSubscriptionStatusByUserId

ユーザーIDを指定してサブスクリプションの契約状況を取得

指定されたユーザーの指定されたコンテンツのサブスクリプション契約状況を取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring~ 128文字ユーザーID
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemSubscriptionStatusサブスクリプションの契約状況

実装例

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.GetSubscriptionStatusByUserId(
    &money2.GetSubscriptionStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ContentName: pointy.String("content-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetSubscriptionStatusByUserIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getSubscriptionStatusByUserId(
        (new GetSubscriptionStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withContentName("content-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetSubscriptionStatusByUserIdRequest;
import io.gs2.money2.result.GetSubscriptionStatusByUserIdResult;

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

try {
    GetSubscriptionStatusByUserIdResult result = client.getSubscriptionStatusByUserId(
        new GetSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .withTimeOffsetToken(null)
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetSubscriptionStatusByUserIdResult> asyncResult = null;
yield return client.GetSubscriptionStatusByUserId(
    new Gs2.Gs2Money2.Request.GetSubscriptionStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithContentName("content-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getSubscriptionStatusByUserId(
        new Gs2Money2.GetSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .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_subscription_status_by_user_id(
        money2.GetSubscriptionStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_content_name('content-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_subscription_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_subscription_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

allocateSubscriptionStatus

レシートからサブスクリプションの契約状況を割り当て

ストアプラットフォーム(Apple App Store / Google Play)に対してレシートを検証し、リクエストユーザーにサブスクリプションを割り当てます。
サブスクリプションが新規に割り当てられた場合、ネームスペースに設定された購読スクリプトが実行され、スケジュールトリガーが更新されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring~ 128文字アクセストークン
receiptstring
~ 1024文字レシート

Result

説明
itemSubscriptionStatusサブスクリプションの契約状況

実装例

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.AllocateSubscriptionStatus(
    &money2.AllocateSubscriptionStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    }
)
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\AllocateSubscriptionStatusRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->allocateSubscriptionStatus(
        (new AllocateSubscriptionStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    $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.AllocateSubscriptionStatusRequest;
import io.gs2.money2.result.AllocateSubscriptionStatusResult;

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

try {
    AllocateSubscriptionStatusResult result = client.allocateSubscriptionStatus(
        new AllocateSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.AllocateSubscriptionStatusResult> asyncResult = null;
yield return client.AllocateSubscriptionStatus(
    new Gs2.Gs2Money2.Request.AllocateSubscriptionStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    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.allocateSubscriptionStatus(
        new Gs2Money2.AllocateSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    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.allocate_subscription_status(
        money2.AllocateSubscriptionStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.allocate_subscription_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.allocate_subscription_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

allocateSubscriptionStatusByUserId

ユーザーIDを指定してレシートからサブスクリプションの契約状況を割り当て

ストアプラットフォームに対してレシートを検証し、指定されたユーザーにサブスクリプションを割り当てます。
サブスクリプションがすでに別のユーザーに割り当てられている場合、AlreadyUsed エラーが返されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring~ 128文字ユーザーID
receiptstring
~ 1024文字レシート
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemSubscriptionStatusサブスクリプションの契約状況

実装例

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.AllocateSubscriptionStatusByUserId(
    &money2.AllocateSubscriptionStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
        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\AllocateSubscriptionStatusByUserIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->allocateSubscriptionStatusByUserId(
        (new AllocateSubscriptionStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            ->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.AllocateSubscriptionStatusByUserIdRequest;
import io.gs2.money2.result.AllocateSubscriptionStatusByUserIdResult;

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

try {
    AllocateSubscriptionStatusByUserIdResult result = client.allocateSubscriptionStatusByUserId(
        new AllocateSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .withTimeOffsetToken(null)
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.AllocateSubscriptionStatusByUserIdResult> asyncResult = null;
yield return client.AllocateSubscriptionStatusByUserId(
    new Gs2.Gs2Money2.Request.AllocateSubscriptionStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
        .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.allocateSubscriptionStatusByUserId(
        new Gs2Money2.AllocateSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .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.allocate_subscription_status_by_user_id(
        money2.AllocateSubscriptionStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.allocate_subscription_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.allocate_subscription_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

takeoverSubscriptionStatus

すでに他のユーザーに割り当てられているサブスクリプションの契約状況を引き継ぐ

現在他のユーザーに割り当てられているサブスクリプションをリクエストユーザーに移譲します。
ネームスペースに設定された引き継ぎスクリプトが実行され、旧ユーザーと新ユーザーの両方のスケジュールトリガーが更新されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
accessTokenstring~ 128文字アクセストークン
receiptstring
~ 1024文字レシート

Result

説明
itemSubscriptionStatusサブスクリプションの契約状況

実装例

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.TakeoverSubscriptionStatus(
    &money2.TakeoverSubscriptionStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    }
)
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\TakeoverSubscriptionStatusRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->takeoverSubscriptionStatus(
        (new TakeoverSubscriptionStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    $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.TakeoverSubscriptionStatusRequest;
import io.gs2.money2.result.TakeoverSubscriptionStatusResult;

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

try {
    TakeoverSubscriptionStatusResult result = client.takeoverSubscriptionStatus(
        new TakeoverSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.TakeoverSubscriptionStatusResult> asyncResult = null;
yield return client.TakeoverSubscriptionStatus(
    new Gs2.Gs2Money2.Request.TakeoverSubscriptionStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    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.takeoverSubscriptionStatus(
        new Gs2Money2.TakeoverSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    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.takeover_subscription_status(
        money2.TakeoverSubscriptionStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.takeover_subscription_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.takeover_subscription_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

takeoverSubscriptionStatusByUserId

ユーザーIDを指定してすでに他のユーザーに割り当てられているサブスクリプションの契約状況を引き継ぐ

現在他のユーザーに割り当てられているサブスクリプションを指定されたユーザーに移譲します。
引き継ぎスクリプトが実行され、両方のユーザーのサブスクリプショントリガーが更新されます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring~ 128文字ユーザーID
receiptstring
~ 1024文字レシート
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemSubscriptionStatusサブスクリプションの契約状況

実装例

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.TakeoverSubscriptionStatusByUserId(
    &money2.TakeoverSubscriptionStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
        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\TakeoverSubscriptionStatusByUserIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->takeoverSubscriptionStatusByUserId(
        (new TakeoverSubscriptionStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            ->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.TakeoverSubscriptionStatusByUserIdRequest;
import io.gs2.money2.result.TakeoverSubscriptionStatusByUserIdResult;

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

try {
    TakeoverSubscriptionStatusByUserIdResult result = client.takeoverSubscriptionStatusByUserId(
        new TakeoverSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .withTimeOffsetToken(null)
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.TakeoverSubscriptionStatusByUserIdResult> asyncResult = null;
yield return client.TakeoverSubscriptionStatusByUserId(
    new Gs2.Gs2Money2.Request.TakeoverSubscriptionStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
        .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.takeoverSubscriptionStatusByUserId(
        new Gs2Money2.TakeoverSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .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.takeover_subscription_status_by_user_id(
        money2.TakeoverSubscriptionStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.takeover_subscription_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.takeover_subscription_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeRefundHistoriesByUserId

ユーザーIDを指定して返金履歴情報の一覧を取得

指定されたユーザーの返金履歴レコードのページネーション付きリストを取得します。
各レコードにはコンテンツ名やプラットフォーム情報を含む返金イベントの詳細が含まれます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
userIdstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<RefundHistory>返金履歴情報のリスト
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.DescribeRefundHistoriesByUserId(
    &money2.DescribeRefundHistoriesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\DescribeRefundHistoriesByUserIdRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeRefundHistoriesByUserId(
        (new DescribeRefundHistoriesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.DescribeRefundHistoriesByUserIdRequest;
import io.gs2.money2.result.DescribeRefundHistoriesByUserIdResult;

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

try {
    DescribeRefundHistoriesByUserIdResult result = client.describeRefundHistoriesByUserId(
        new DescribeRefundHistoriesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<RefundHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeRefundHistoriesByUserIdResult> asyncResult = null;
yield return client.DescribeRefundHistoriesByUserId(
    new Gs2.Gs2Money2.Request.DescribeRefundHistoriesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.describeRefundHistoriesByUserId(
        new Gs2Money2.DescribeRefundHistoriesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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_refund_histories_by_user_id(
        money2.DescribeRefundHistoriesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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_refund_histories_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_refund_histories_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

describeRefundHistoriesByDate

年と月を指定して返金履歴情報の一覧を取得

年と月でフィルタリングされた返金履歴レコードのページネーション付きリストを取得します。
オプションで日によるフィルタリングも可能です。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
yearint
2000 ~ 3000
monthint
1 ~ 12
dayint1 ~ 31
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<RefundHistory>返金履歴情報のリスト
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.DescribeRefundHistoriesByDate(
    &money2.DescribeRefundHistoriesByDateRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Year: pointy.Int32(2025),
        Month: pointy.Int32(1),
        Day: nil,
        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\DescribeRefundHistoriesByDateRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeRefundHistoriesByDate(
        (new DescribeRefundHistoriesByDateRequest())
            ->withNamespaceName("namespace-0001")
            ->withYear(2025)
            ->withMonth(1)
            ->withDay(null)
            ->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.DescribeRefundHistoriesByDateRequest;
import io.gs2.money2.result.DescribeRefundHistoriesByDateResult;

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

try {
    DescribeRefundHistoriesByDateResult result = client.describeRefundHistoriesByDate(
        new DescribeRefundHistoriesByDateRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2025)
            .withMonth(1)
            .withDay(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RefundHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeRefundHistoriesByDateResult> asyncResult = null;
yield return client.DescribeRefundHistoriesByDate(
    new Gs2.Gs2Money2.Request.DescribeRefundHistoriesByDateRequest()
        .WithNamespaceName("namespace-0001")
        .WithYear(2025)
        .WithMonth(1)
        .WithDay(null)
        .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.describeRefundHistoriesByDate(
        new Gs2Money2.DescribeRefundHistoriesByDateRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2025)
            .withMonth(1)
            .withDay(null)
            .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_refund_histories_by_date(
        money2.DescribeRefundHistoriesByDateRequest()
            .with_namespace_name('namespace-0001')
            .with_year(2025)
            .with_month(1)
            .with_day(None)
            .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_refund_histories_by_date({
    namespaceName="namespace-0001",
    year=2025,
    month=1,
    day=nil,
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_refund_histories_by_date_async({
    namespaceName="namespace-0001",
    year=2025,
    month=1,
    day=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

getRefundHistory

トランザクションIDを指定して返金履歴情報を取得

トランザクションIDで特定の返金履歴レコードを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
transactionIdstring
~ 1024文字トランザクションID
ストアプラットフォームによって割り当てられた一意のトランザクション識別子です。同一購入の重複処理を防止するために使用されます。

Result

説明
itemRefundHistory返金履歴情報

実装例

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.GetRefundHistory(
    &money2.GetRefundHistoryRequest {
        NamespaceName: pointy.String("namespace-0001"),
        TransactionId: pointy.String("transaction-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\GetRefundHistoryRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getRefundHistory(
        (new GetRefundHistoryRequest())
            ->withNamespaceName("namespace-0001")
            ->withTransactionId("transaction-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.GetRefundHistoryRequest;
import io.gs2.money2.result.GetRefundHistoryResult;

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

try {
    GetRefundHistoryResult result = client.getRefundHistory(
        new GetRefundHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-0001")
    );
    RefundHistory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetRefundHistoryResult> asyncResult = null;
yield return client.GetRefundHistory(
    new Gs2.Gs2Money2.Request.GetRefundHistoryRequest()
        .WithNamespaceName("namespace-0001")
        .WithTransactionId("transaction-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.getRefundHistory(
        new Gs2Money2.GetRefundHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-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.get_refund_history(
        money2.GetRefundHistoryRequest()
            .with_namespace_name('namespace-0001')
            .with_transaction_id('transaction-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_refund_history({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_refund_history_async({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeDailyTransactionHistoriesByCurrency

通貨を指定して日々の取引履歴の一覧を取得

指定された通貨と年でフィルタリングされた日次取引履歴のページネーション付きリストを取得します。
オプションで月によるフィルタリングも可能です。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
currencystring
~ 8文字通貨コード
yearint
2000 ~ 3000
monthint1 ~ 12
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<DailyTransactionHistory>日々の取引履歴のリスト
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.DescribeDailyTransactionHistoriesByCurrency(
    &money2.DescribeDailyTransactionHistoriesByCurrencyRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Currency: pointy.String("JPY"),
        Year: pointy.Int32(2024),
        Month: pointy.Int32(1),
        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\DescribeDailyTransactionHistoriesByCurrencyRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeDailyTransactionHistoriesByCurrency(
        (new DescribeDailyTransactionHistoriesByCurrencyRequest())
            ->withNamespaceName("namespace-0001")
            ->withCurrency("JPY")
            ->withYear(2024)
            ->withMonth(1)
            ->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.DescribeDailyTransactionHistoriesByCurrencyRequest;
import io.gs2.money2.result.DescribeDailyTransactionHistoriesByCurrencyResult;

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

try {
    DescribeDailyTransactionHistoriesByCurrencyResult result = client.describeDailyTransactionHistoriesByCurrency(
        new DescribeDailyTransactionHistoriesByCurrencyRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
            .withYear(2024)
            .withMonth(1)
            .withPageToken(null)
            .withLimit(null)
    );
    List<DailyTransactionHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeDailyTransactionHistoriesByCurrencyResult> asyncResult = null;
yield return client.DescribeDailyTransactionHistoriesByCurrency(
    new Gs2.Gs2Money2.Request.DescribeDailyTransactionHistoriesByCurrencyRequest()
        .WithNamespaceName("namespace-0001")
        .WithCurrency("JPY")
        .WithYear(2024)
        .WithMonth(1)
        .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.describeDailyTransactionHistoriesByCurrency(
        new Gs2Money2.DescribeDailyTransactionHistoriesByCurrencyRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
            .withYear(2024)
            .withMonth(1)
            .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_daily_transaction_histories_by_currency(
        money2.DescribeDailyTransactionHistoriesByCurrencyRequest()
            .with_namespace_name('namespace-0001')
            .with_currency('JPY')
            .with_year(2024)
            .with_month(1)
            .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_daily_transaction_histories_by_currency({
    namespaceName="namespace-0001",
    currency="JPY",
    year=2024,
    month=1,
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_daily_transaction_histories_by_currency_async({
    namespaceName="namespace-0001",
    currency="JPY",
    year=2024,
    month=1,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

describeDailyTransactionHistories

日々の取引履歴の一覧を取得

指定された年の日次取引履歴のページネーション付きリストを取得します。
オプションで月によるフィルタリングが可能で、月を指定した場合はさらに日でフィルタリングできます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
yearint
2000 ~ 3000
monthint1 ~ 12
dayint{month} > 01 ~ 31
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<DailyTransactionHistory>日々の取引履歴のリスト
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.DescribeDailyTransactionHistories(
    &money2.DescribeDailyTransactionHistoriesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Year: pointy.Int32(2024),
        Month: pointy.Int32(1),
        Day: pointy.Int32(2),
        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\DescribeDailyTransactionHistoriesRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeDailyTransactionHistories(
        (new DescribeDailyTransactionHistoriesRequest())
            ->withNamespaceName("namespace-0001")
            ->withYear(2024)
            ->withMonth(1)
            ->withDay(2)
            ->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.DescribeDailyTransactionHistoriesRequest;
import io.gs2.money2.result.DescribeDailyTransactionHistoriesResult;

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

try {
    DescribeDailyTransactionHistoriesResult result = client.describeDailyTransactionHistories(
        new DescribeDailyTransactionHistoriesRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .withPageToken(null)
            .withLimit(null)
    );
    List<DailyTransactionHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeDailyTransactionHistoriesResult> asyncResult = null;
yield return client.DescribeDailyTransactionHistories(
    new Gs2.Gs2Money2.Request.DescribeDailyTransactionHistoriesRequest()
        .WithNamespaceName("namespace-0001")
        .WithYear(2024)
        .WithMonth(1)
        .WithDay(2)
        .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.describeDailyTransactionHistories(
        new Gs2Money2.DescribeDailyTransactionHistoriesRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .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_daily_transaction_histories(
        money2.DescribeDailyTransactionHistoriesRequest()
            .with_namespace_name('namespace-0001')
            .with_year(2024)
            .with_month(1)
            .with_day(2)
            .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_daily_transaction_histories({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_daily_transaction_histories_async({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

getDailyTransactionHistory

日付と通貨を指定して日々の取引履歴を取得

指定された日付と通貨の日次取引履歴レコードを取得します。
レコードにはその日の入出金額および発行/消費回数が含まれます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
yearint
2000 ~ 3000
monthint
1 ~ 12
dayint
1 ~ 31
currencystring
~ 8文字通貨コード

Result

説明
itemDailyTransactionHistory日々の取引履歴

実装例

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.GetDailyTransactionHistory(
    &money2.GetDailyTransactionHistoryRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Year: pointy.Int32(2024),
        Month: pointy.Int32(1),
        Day: pointy.Int32(2),
        Currency: pointy.String("JPY"),
    }
)
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\GetDailyTransactionHistoryRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getDailyTransactionHistory(
        (new GetDailyTransactionHistoryRequest())
            ->withNamespaceName("namespace-0001")
            ->withYear(2024)
            ->withMonth(1)
            ->withDay(2)
            ->withCurrency("JPY")
    );
    $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.GetDailyTransactionHistoryRequest;
import io.gs2.money2.result.GetDailyTransactionHistoryResult;

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

try {
    GetDailyTransactionHistoryResult result = client.getDailyTransactionHistory(
        new GetDailyTransactionHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .withCurrency("JPY")
    );
    DailyTransactionHistory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetDailyTransactionHistoryResult> asyncResult = null;
yield return client.GetDailyTransactionHistory(
    new Gs2.Gs2Money2.Request.GetDailyTransactionHistoryRequest()
        .WithNamespaceName("namespace-0001")
        .WithYear(2024)
        .WithMonth(1)
        .WithDay(2)
        .WithCurrency("JPY"),
    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.getDailyTransactionHistory(
        new Gs2Money2.GetDailyTransactionHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .withCurrency("JPY")
    );
    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_daily_transaction_history(
        money2.GetDailyTransactionHistoryRequest()
            .with_namespace_name('namespace-0001')
            .with_year(2024)
            .with_month(1)
            .with_day(2)
            .with_currency('JPY')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_daily_transaction_history({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    currency="JPY",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_daily_transaction_history_async({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    currency="JPY",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeUnusedBalances

未使用残高の一覧を取得

ネームスペースの未使用残高レコードのページネーション付きリストを取得します。
各レコードは特定の通貨の未使用有償通貨残高を表します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<UnusedBalance>未使用残高のリスト
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.DescribeUnusedBalances(
    &money2.DescribeUnusedBalancesRequest {
        NamespaceName: pointy.String("namespace-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\DescribeUnusedBalancesRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeUnusedBalances(
        (new DescribeUnusedBalancesRequest())
            ->withNamespaceName("namespace-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeUnusedBalancesRequest;
import io.gs2.money2.result.DescribeUnusedBalancesResult;

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

try {
    DescribeUnusedBalancesResult result = client.describeUnusedBalances(
        new DescribeUnusedBalancesRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<UnusedBalance> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeUnusedBalancesResult> asyncResult = null;
yield return client.DescribeUnusedBalances(
    new Gs2.Gs2Money2.Request.DescribeUnusedBalancesRequest()
        .WithNamespaceName("namespace-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.describeUnusedBalances(
        new Gs2Money2.DescribeUnusedBalancesRequest()
            .withNamespaceName("namespace-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_unused_balances(
        money2.DescribeUnusedBalancesRequest()
            .with_namespace_name('namespace-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_unused_balances({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_unused_balances_async({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

getUnusedBalance

通貨を指定して未使用残高を取得

指定された通貨の未使用残高を取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
currencystring
~ 8文字通貨コード
未使用残高が追跡されるISO通貨コード(例:“JPY”、“USD”)です。

Result

説明
itemUnusedBalance未使用残高

実装例

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.GetUnusedBalance(
    &money2.GetUnusedBalanceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Currency: pointy.String("JPY"),
    }
)
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\GetUnusedBalanceRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getUnusedBalance(
        (new GetUnusedBalanceRequest())
            ->withNamespaceName("namespace-0001")
            ->withCurrency("JPY")
    );
    $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.GetUnusedBalanceRequest;
import io.gs2.money2.result.GetUnusedBalanceResult;

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

try {
    GetUnusedBalanceResult result = client.getUnusedBalance(
        new GetUnusedBalanceRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
    );
    UnusedBalance item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetUnusedBalanceResult> asyncResult = null;
yield return client.GetUnusedBalance(
    new Gs2.Gs2Money2.Request.GetUnusedBalanceRequest()
        .WithNamespaceName("namespace-0001")
        .WithCurrency("JPY"),
    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.getUnusedBalance(
        new Gs2Money2.GetUnusedBalanceRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
    );
    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_unused_balance(
        money2.GetUnusedBalanceRequest()
            .with_namespace_name('namespace-0001')
            .with_currency('JPY')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_unused_balance({
    namespaceName="namespace-0001",
    currency="JPY",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_unused_balance_async({
    namespaceName="namespace-0001",
    currency="JPY",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeStoreContentModels

ストアコンテンツモデルの一覧を取得

現在アクティブなストアコンテンツモデルのリストを取得します。
これらのモデルは、プラットフォーム固有のプロダクトIDを持つ購入可能なコンテンツアイテムを定義します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
itemsList<StoreContentModel>ストアコンテンツモデルのリスト

実装例

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.DescribeStoreContentModels(
    &money2.DescribeStoreContentModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeStoreContentModelsRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreContentModels(
        (new DescribeStoreContentModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeStoreContentModelsRequest;
import io.gs2.money2.result.DescribeStoreContentModelsResult;

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

try {
    DescribeStoreContentModelsResult result = client.describeStoreContentModels(
        new DescribeStoreContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<StoreContentModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreContentModelsResult> asyncResult = null;
yield return client.DescribeStoreContentModels(
    new Gs2.Gs2Money2.Request.DescribeStoreContentModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeStoreContentModels(
        new Gs2Money2.DescribeStoreContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} 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_store_content_models(
        money2.DescribeStoreContentModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_store_content_models({
    namespaceName="namespace-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_store_content_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getStoreContentModel

ストアコンテンツモデルを取得

Apple App Store および Google Play の設定を含む、指定されたストアコンテンツモデルを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストアコンテンツモデル名

Result

説明
itemStoreContentModelストアコンテンツモデル

実装例

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.GetStoreContentModel(
    &money2.GetStoreContentModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-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\GetStoreContentModelRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreContentModel(
        (new GetStoreContentModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-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.GetStoreContentModelRequest;
import io.gs2.money2.result.GetStoreContentModelResult;

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

try {
    GetStoreContentModelResult result = client.getStoreContentModel(
        new GetStoreContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreContentModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreContentModelResult> asyncResult = null;
yield return client.GetStoreContentModel(
    new Gs2.Gs2Money2.Request.GetStoreContentModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-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.getStoreContentModel(
        new Gs2Money2.GetStoreContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-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.get_store_content_model(
        money2.GetStoreContentModelRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_content_model({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_content_model_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeStoreSubscriptionContentModels

ストア定期課金コンテンツモデルの一覧を取得

現在アクティブなストア定期課金コンテンツモデルのリストを取得します。
これらのモデルは、プラットフォーム固有の設定とスケジューリングパラメータを持つサブスクリプション商品を定義します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
itemsList<StoreSubscriptionContentModel>ストア定期課金コンテンツモデルモデルのリスト

実装例

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.DescribeStoreSubscriptionContentModels(
    &money2.DescribeStoreSubscriptionContentModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeStoreSubscriptionContentModelsRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreSubscriptionContentModels(
        (new DescribeStoreSubscriptionContentModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeStoreSubscriptionContentModelsRequest;
import io.gs2.money2.result.DescribeStoreSubscriptionContentModelsResult;

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

try {
    DescribeStoreSubscriptionContentModelsResult result = client.describeStoreSubscriptionContentModels(
        new DescribeStoreSubscriptionContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<StoreSubscriptionContentModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreSubscriptionContentModelsResult> asyncResult = null;
yield return client.DescribeStoreSubscriptionContentModels(
    new Gs2.Gs2Money2.Request.DescribeStoreSubscriptionContentModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeStoreSubscriptionContentModels(
        new Gs2Money2.DescribeStoreSubscriptionContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} 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_store_subscription_content_models(
        money2.DescribeStoreSubscriptionContentModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_store_subscription_content_models({
    namespaceName="namespace-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_store_subscription_content_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getStoreSubscriptionContentModel

ストア定期課金コンテンツモデルを取得

指定されたストア定期課金コンテンツモデルを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名

Result

説明
itemStoreSubscriptionContentModelストア定期課金コンテンツモデルモデル

実装例

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.GetStoreSubscriptionContentModel(
    &money2.GetStoreSubscriptionContentModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-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\GetStoreSubscriptionContentModelRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreSubscriptionContentModel(
        (new GetStoreSubscriptionContentModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-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.GetStoreSubscriptionContentModelRequest;
import io.gs2.money2.result.GetStoreSubscriptionContentModelResult;

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

try {
    GetStoreSubscriptionContentModelResult result = client.getStoreSubscriptionContentModel(
        new GetStoreSubscriptionContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreSubscriptionContentModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreSubscriptionContentModelResult> asyncResult = null;
yield return client.GetStoreSubscriptionContentModel(
    new Gs2.Gs2Money2.Request.GetStoreSubscriptionContentModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-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.getStoreSubscriptionContentModel(
        new Gs2Money2.GetStoreSubscriptionContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-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.get_store_subscription_content_model(
        money2.GetStoreSubscriptionContentModelRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_subscription_content_model({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_subscription_content_model_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

exportMaster

モデルマスターを有効化可能なマスターデータ形式でエクスポート

現在登録されているモデルマスター(ストアコンテンツモデルおよび定期課金コンテンツモデル)を有効化可能なマスターデータ形式でエクスポートします。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
itemCurrentModelMaster有効化可能なマスターデータ

実装例

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.ExportMaster(
    &money2.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-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\ExportMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-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.ExportMasterRequest;
import io.gs2.money2.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Money2.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-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.exportMaster(
        new Gs2Money2.ExportMasterRequest()
            .withNamespaceName("namespace-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.export_master(
        money2.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.export_master({
    namespaceName="namespace-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.export_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getCurrentModelMaster

現在アクティブなモデルのマスターデータを取得

ストアコンテンツモデルおよび定期課金コンテンツモデルを含む、現在アクティブなモデルのマスターデータを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
itemCurrentModelMaster現在アクティブなモデルのマスターデータ

実装例

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.GetCurrentModelMaster(
    &money2.GetCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-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\GetCurrentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getCurrentModelMaster(
        (new GetCurrentModelMasterRequest())
            ->withNamespaceName("namespace-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.GetCurrentModelMasterRequest;
import io.gs2.money2.result.GetCurrentModelMasterResult;

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

try {
    GetCurrentModelMasterResult result = client.getCurrentModelMaster(
        new GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
    new Gs2.Gs2Money2.Request.GetCurrentModelMasterRequest()
        .WithNamespaceName("namespace-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.getCurrentModelMaster(
        new Gs2Money2.GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-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.get_current_model_master(
        money2.GetCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_current_model_master({
    namespaceName="namespace-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_current_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

preUpdateCurrentModelMaster

現在アクティブなモデルのマスターデータを更新(3フェーズ版)

1MBを超えるマスターデータをアップロードする場合は、3フェーズで更新を行います。

  1. このAPIを実行し、アップロード用のトークンとURLを取得します。
  2. 取得したURLに対して、マスターデータをアップロードします。
  3. UpdateCurrentModelMaster にアップロードで取得したトークンを渡して実行し、マスターデータを反映します。
詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

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.PreUpdateCurrentModelMaster(
    &money2.PreUpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
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\PreUpdateCurrentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentModelMaster(
        (new PreUpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $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.PreUpdateCurrentModelMasterRequest;
import io.gs2.money2.result.PreUpdateCurrentModelMasterResult;

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

try {
    PreUpdateCurrentModelMasterResult result = client.preUpdateCurrentModelMaster(
        new PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.PreUpdateCurrentModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentModelMaster(
    new Gs2.Gs2Money2.Request.PreUpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001"),
    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.preUpdateCurrentModelMaster(
        new Gs2Money2.PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    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.pre_update_current_model_master(
        money2.PreUpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.pre_update_current_model_master({
    namespaceName="namespace-0001",
})

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('money2')

api_result_handler = client.pre_update_current_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

updateCurrentModelMaster

現在アクティブなモデルのマスターデータを更新

現在アクティブなモデルのマスターデータを更新します。大容量マスターデータに対応するため、直接更新モードと事前アップロードモードの両方をサポートしています。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
mode文字列列挙型
enum {
  “direct”,
  “preUpload”
}
“direct”更新モード
定義説明
“direct”マスターデータを直接更新
“preUpload”マスターデータをアップロードしてから更新
settingsstring{mode} == “direct”
✓※
~ 5242880文字マスターデータ
※ mode が “direct” であれば必須
uploadTokenstring{mode} == “preUpload”
✓※
~ 1024文字事前アップロードで取得したトークン
アップロードしたマスターデータを適用するために使用されます。
※ mode が “preUpload” であれば必須

Result

説明
itemCurrentModelMaster更新された現在アクティブなモデルのマスターデータ

実装例

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.UpdateCurrentModelMaster(
    &money2.UpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}"),
        UploadToken: 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\UpdateCurrentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMaster(
        (new UpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
            ->withUploadToken(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.UpdateCurrentModelMasterRequest;
import io.gs2.money2.result.UpdateCurrentModelMasterResult;

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

try {
    UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
        new UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
            .withUploadToken(null)
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
    new Gs2.Gs2Money2.Request.UpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
        .WithUploadToken(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.updateCurrentModelMaster(
        new Gs2Money2.UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
            .withUploadToken(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.update_current_model_master(
        money2.UpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-06-20", "storeContentModels": [{"name": "content-0001", "appleAppStore": {"productId": "io.gs2.sample.apple.product1"}, "googlePlay": {"productId": "io.gs2.sample.google.product1"}}, {"name": "content-0002", "appleAppStore": {"productId": "io.gs2.sample.apple.product2"}, "googlePlay": {"productId": "io.gs2.sample.google.product2"}}, {"name": "apple-only-0001", "appleAppStore": {"productId": "io.gs2.sample.apple.product3"}}, {"name": "google-only-0001", "googlePlay": {"productId": "io.gs2.sample.google.product3"}}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_current_model_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}",
    uploadToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_current_model_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}",
    uploadToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateCurrentModelMasterFromGitHub

現在アクティブなモデルのマスターデータをGitHubから更新

指定されたチェックアウト設定を使用して GitHub リポジトリからマスターデータをチェックアウトし、現在アクティブなモデルのマスターデータを更新します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
checkoutSettingGitHubCheckoutSetting
GitHubからマスターデータをチェックアウトする設定

Result

説明
itemCurrentModelMaster更新された現在アクティブなモデルのマスターデータ

実装例

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.UpdateCurrentModelMasterFromGitHub(
    &money2.UpdateCurrentModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &money2.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\UpdateCurrentModelMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMasterFromGitHub(
        (new UpdateCurrentModelMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.money2.result.UpdateCurrentModelMasterFromGitHubResult;

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

try {
    UpdateCurrentModelMasterFromGitHubResult result = client.updateCurrentModelMasterFromGitHub(
        new UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
    new Gs2.Gs2Money2.Request.UpdateCurrentModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Money2.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentModelMasterFromGitHub(
        new Gs2Money2.UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Money2.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_current_model_master_from_git_hub(
        money2.UpdateCurrentModelMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(money2.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_current_model_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_current_model_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeStoreContentModelMasters

ストアコンテンツモデルマスターの一覧を取得

ストアコンテンツモデルマスターのページネーション付きリストを取得します。
名前のプレフィックスでフィルタリングできます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
namePrefixstring~ 64文字ストアコンテンツ名のフィルター接頭辞
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<StoreContentModelMaster>ストアコンテンツモデルマスターのリスト
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.DescribeStoreContentModelMasters(
    &money2.DescribeStoreContentModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        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\DescribeStoreContentModelMastersRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreContentModelMasters(
        (new DescribeStoreContentModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->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.DescribeStoreContentModelMastersRequest;
import io.gs2.money2.result.DescribeStoreContentModelMastersResult;

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

try {
    DescribeStoreContentModelMastersResult result = client.describeStoreContentModelMasters(
        new DescribeStoreContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<StoreContentModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreContentModelMastersResult> asyncResult = null;
yield return client.DescribeStoreContentModelMasters(
    new Gs2.Gs2Money2.Request.DescribeStoreContentModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .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.describeStoreContentModelMasters(
        new Gs2Money2.DescribeStoreContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .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_store_content_model_masters(
        money2.DescribeStoreContentModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .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_store_content_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_store_content_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

createStoreContentModelMaster

ストアコンテンツマスターを新規作成

Apple App Store および Google Play のプロダクトID用のプラットフォーム固有設定を持つ新しいストアコンテンツモデルマスターを作成します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
namestring
~ 128文字ストアコンテンツモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
appleAppStoreAppleAppStoreContentApple AppStore のコンテンツ
このストアコンテンツの Apple App Store 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。
googlePlayGooglePlayContentGoogle Play のコンテンツ
このストアコンテンツの Google Play 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。

Result

説明
itemStoreContentModelMaster作成したストアコンテンツマスター

実装例

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.CreateStoreContentModelMaster(
    &money2.CreateStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("content-0001"),
        Description: nil,
        Metadata: nil,
        AppleAppStore: &money2.AppleAppStoreContent{
            ProductId: pointy.String("io.gs2.sample.apple.product1"),
        },
        GooglePlay: &money2.GooglePlayContent{
            ProductId: pointy.String("io.gs2.sample.google.product1"),
        },
    }
)
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\CreateStoreContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->createStoreContentModelMaster(
        (new CreateStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("content-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreContent())
                ->withProductId("io.gs2.sample.apple.product1"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlayContent())
                ->withProductId("io.gs2.sample.google.product1"))
    );
    $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.CreateStoreContentModelMasterRequest;
import io.gs2.money2.result.CreateStoreContentModelMasterResult;

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

try {
    CreateStoreContentModelMasterResult result = client.createStoreContentModelMaster(
        new CreateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product1"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CreateStoreContentModelMasterResult> asyncResult = null;
yield return client.CreateStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.CreateStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("content-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreContent()
            .WithProductId("io.gs2.sample.apple.product1"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlayContent()
            .WithProductId("io.gs2.sample.google.product1")),
    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.createStoreContentModelMaster(
        new Gs2Money2.CreateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product1"))
            .withGooglePlay(new Gs2Money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    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_store_content_model_master(
        money2.CreateStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('content-0001')
            .with_description(None)
            .with_metadata(None)
            .with_apple_app_store(
                money2.AppleAppStoreContent()
                    .with_product_id('io.gs2.sample.apple.product1'))
            .with_google_play(
                money2.GooglePlayContent()
                    .with_product_id('io.gs2.sample.google.product1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.create_store_content_model_master({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product1",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.create_store_content_model_master_async({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product1",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getStoreContentModelMaster

ストアコンテンツマスターを取得

指定されたストアコンテンツモデルマスターを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストアコンテンツモデル名

Result

説明
itemStoreContentModelMasterストアコンテンツマスター

実装例

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.GetStoreContentModelMaster(
    &money2.GetStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-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\GetStoreContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreContentModelMaster(
        (new GetStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-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.GetStoreContentModelMasterRequest;
import io.gs2.money2.result.GetStoreContentModelMasterResult;

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

try {
    GetStoreContentModelMasterResult result = client.getStoreContentModelMaster(
        new GetStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreContentModelMasterResult> asyncResult = null;
yield return client.GetStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.GetStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-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.getStoreContentModelMaster(
        new Gs2Money2.GetStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-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.get_store_content_model_master(
        money2.GetStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateStoreContentModelMaster

ストアコンテンツマスターを更新

指定されたストアコンテンツモデルマスターを更新します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストアコンテンツモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
appleAppStoreAppleAppStoreContentApple AppStore のコンテンツ
このストアコンテンツの Apple App Store 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。
googlePlayGooglePlayContentGoogle Play のコンテンツ
このストアコンテンツの Google Play 商品情報(プロダクトID)です。レシート検証時に購入された商品との照合に使用されます。

Result

説明
itemStoreContentModelMaster更新したストアコンテンツマスター

実装例

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.UpdateStoreContentModelMaster(
    &money2.UpdateStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        AppleAppStore: &money2.AppleAppStoreContent{
            ProductId: pointy.String("io.gs2.sample.apple.product2"),
        },
        GooglePlay: &money2.GooglePlayContent{
            ProductId: pointy.String("io.gs2.sample.google.product2"),
        },
    }
)
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\UpdateStoreContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateStoreContentModelMaster(
        (new UpdateStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreContent())
                ->withProductId("io.gs2.sample.apple.product2"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlayContent())
                ->withProductId("io.gs2.sample.google.product2"))
    );
    $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.UpdateStoreContentModelMasterRequest;
import io.gs2.money2.result.UpdateStoreContentModelMasterResult;

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

try {
    UpdateStoreContentModelMasterResult result = client.updateStoreContentModelMaster(
        new UpdateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product2"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateStoreContentModelMasterResult> asyncResult = null;
yield return client.UpdateStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.UpdateStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreContent()
            .WithProductId("io.gs2.sample.apple.product2"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlayContent()
            .WithProductId("io.gs2.sample.google.product2")),
    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.updateStoreContentModelMaster(
        new Gs2Money2.UpdateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product2"))
            .withGooglePlay(new Gs2Money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    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_store_content_model_master(
        money2.UpdateStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_apple_app_store(
                money2.AppleAppStoreContent()
                    .with_product_id('io.gs2.sample.apple.product2'))
            .with_google_play(
                money2.GooglePlayContent()
                    .with_product_id('io.gs2.sample.google.product2'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_store_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product2",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_store_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product2",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

deleteStoreContentModelMaster

ストアコンテンツマスターを削除

指定されたストアコンテンツモデルマスターを削除します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストアコンテンツモデル名

Result

説明
itemStoreContentModelMaster削除したストアコンテンツマスター

実装例

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.DeleteStoreContentModelMaster(
    &money2.DeleteStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-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\DeleteStoreContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->deleteStoreContentModelMaster(
        (new DeleteStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-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.DeleteStoreContentModelMasterRequest;
import io.gs2.money2.result.DeleteStoreContentModelMasterResult;

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

try {
    DeleteStoreContentModelMasterResult result = client.deleteStoreContentModelMaster(
        new DeleteStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DeleteStoreContentModelMasterResult> asyncResult = null;
yield return client.DeleteStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.DeleteStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-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.deleteStoreContentModelMaster(
        new Gs2Money2.DeleteStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-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.delete_store_content_model_master(
        money2.DeleteStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.delete_store_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.delete_store_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeStoreSubscriptionContentModelMasters

ストア定期課金コンテンツモデルマスターの一覧を取得

ストア定期課金コンテンツモデルマスターのページネーション付きリストを取得します。
名前のプレフィックスでフィルタリングできます。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
namePrefixstring~ 64文字ストア定期課金コンテンツモデル名のフィルター接頭辞
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<StoreSubscriptionContentModelMaster>ストア定期課金コンテンツモデルマスターのリスト
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.DescribeStoreSubscriptionContentModelMasters(
    &money2.DescribeStoreSubscriptionContentModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        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\DescribeStoreSubscriptionContentModelMastersRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreSubscriptionContentModelMasters(
        (new DescribeStoreSubscriptionContentModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->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.DescribeStoreSubscriptionContentModelMastersRequest;
import io.gs2.money2.result.DescribeStoreSubscriptionContentModelMastersResult;

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

try {
    DescribeStoreSubscriptionContentModelMastersResult result = client.describeStoreSubscriptionContentModelMasters(
        new DescribeStoreSubscriptionContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<StoreSubscriptionContentModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreSubscriptionContentModelMastersResult> asyncResult = null;
yield return client.DescribeStoreSubscriptionContentModelMasters(
    new Gs2.Gs2Money2.Request.DescribeStoreSubscriptionContentModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .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.describeStoreSubscriptionContentModelMasters(
        new Gs2Money2.DescribeStoreSubscriptionContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .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_store_subscription_content_model_masters(
        money2.DescribeStoreSubscriptionContentModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .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_store_subscription_content_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_store_subscription_content_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

createStoreSubscriptionContentModelMaster

ストア定期課金コンテンツモデルマスターを新規作成

スケジューリングパラメータと Apple App Store および Google Play のプラットフォーム固有設定を持つ新しいストア定期課金コンテンツモデルマスターを作成します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
namestring
~ 128文字ストア定期課金コンテンツモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
scheduleNamespaceIdstring
~ 1024文字サブスクリプション期間を連動させる GS2-Schedule のネームスペース GRN
triggerNamestring
~ 128文字サブスクリプション期間を反映するトリガー名
サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。
triggerExtendMode文字列列挙型
enum {
  “just”,
  “rollupHour”
}
“just”サブスクリプション期間をトリガーに反映する時のモード
サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。“just” はサブスクリプション期間をそのまま使用します。“rollupHour” は指定した時刻(UTC)まで延長し、日中の期限切れを回避します。
定義説明
“just”そのままサブスクリプション期間を反映
“rollupHour”次の日跨ぎ時刻まで延長してサブスクリプション期間を反映
rollupHourint{triggerExtendMode} == “rollupHour”00 ~ 23日跨ぎの時刻 (UTC)
triggerExtendMode が “rollupHour” の場合、サブスクリプション期間は有効期限日のこの時刻(0〜23、UTC)まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。
※ triggerExtendMode が “rollupHour” であれば必須
reallocateSpanDaysint300 ~ 365サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間(日)
最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。
appleAppStoreAppleAppStoreSubscriptionContentApple AppStore のコンテンツ
このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報(サブスクリプショングループID)です。
googlePlayGooglePlaySubscriptionContentGoogle Play のコンテンツ
このサブスクリプションコンテンツの Google Play のサブスクリプション情報(プロダクトID)です。

Result

説明
itemStoreSubscriptionContentModelMaster作成したストア定期課金コンテンツモデルマスター

実装例

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.CreateStoreSubscriptionContentModelMaster(
    &money2.CreateStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("content-0001"),
        Description: nil,
        Metadata: nil,
        ScheduleNamespaceId: pointy.String("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName"),
        TriggerName: pointy.String("trigger-0001"),
        TriggerExtendMode: nil,
        RollupHour: nil,
        ReallocateSpanDays: nil,
        AppleAppStore: &money2.AppleAppStoreSubscriptionContent{
            SubscriptionGroupIdentifier: pointy.String("21642260"),
        },
        GooglePlay: &money2.GooglePlaySubscriptionContent{
            ProductId: pointy.String("io.gs2.sample.google.product1"),
        },
    }
)
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\CreateStoreSubscriptionContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->createStoreSubscriptionContentModelMaster(
        (new CreateStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("content-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            ->withTriggerName("trigger-0001")
            ->withTriggerExtendMode(null)
            ->withRollupHour(null)
            ->withReallocateSpanDays(null)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreSubscriptionContent())
                ->withSubscriptionGroupIdentifier("21642260"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlaySubscriptionContent())
                ->withProductId("io.gs2.sample.google.product1"))
    );
    $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.CreateStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.CreateStoreSubscriptionContentModelMasterResult;

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

try {
    CreateStoreSubscriptionContentModelMasterResult result = client.createStoreSubscriptionContentModelMaster(
        new CreateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(null)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CreateStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.CreateStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.CreateStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("content-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
        .WithTriggerName("trigger-0001")
        .WithTriggerExtendMode(null)
        .WithRollupHour(null)
        .WithReallocateSpanDays(null)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreSubscriptionContent()
            .WithSubscriptionGroupIdentifier("21642260"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlaySubscriptionContent()
            .WithProductId("io.gs2.sample.google.product1")),
    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.createStoreSubscriptionContentModelMaster(
        new Gs2Money2.CreateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(null)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new Gs2Money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    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_store_subscription_content_model_master(
        money2.CreateStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('content-0001')
            .with_description(None)
            .with_metadata(None)
            .with_schedule_namespace_id('grn:ap-northeast-1:YourOwnerId:schedule:namespaceName')
            .with_trigger_name('trigger-0001')
            .with_trigger_extend_mode(None)
            .with_rollup_hour(None)
            .with_reallocate_span_days(None)
            .with_apple_app_store(
                money2.AppleAppStoreSubscriptionContent()
                    .with_subscription_group_identifier('21642260'))
            .with_google_play(
                money2.GooglePlaySubscriptionContent()
                    .with_product_id('io.gs2.sample.google.product1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.create_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=nil,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.create_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=nil,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getStoreSubscriptionContentModelMaster

ストア定期課金コンテンツモデルマスターを取得

指定されたストア定期課金コンテンツモデルマスターを取得します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名

Result

説明
itemStoreSubscriptionContentModelMasterストア定期課金コンテンツモデルマスター

実装例

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.GetStoreSubscriptionContentModelMaster(
    &money2.GetStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-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\GetStoreSubscriptionContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreSubscriptionContentModelMaster(
        (new GetStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-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.GetStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.GetStoreSubscriptionContentModelMasterResult;

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

try {
    GetStoreSubscriptionContentModelMasterResult result = client.getStoreSubscriptionContentModelMaster(
        new GetStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.GetStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.GetStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-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.getStoreSubscriptionContentModelMaster(
        new Gs2Money2.GetStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-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.get_store_subscription_content_model_master(
        money2.GetStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateStoreSubscriptionContentModelMaster

ストア定期課金コンテンツモデルマスターを更新

指定されたストア定期課金コンテンツモデルマスターを更新します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
scheduleNamespaceIdstring
~ 1024文字サブスクリプション期間を連動させる GS2-Schedule のネームスペース GRN
triggerNamestring
~ 128文字サブスクリプション期間を反映するトリガー名
サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。
triggerExtendMode文字列列挙型
enum {
  “just”,
  “rollupHour”
}
“just”サブスクリプション期間をトリガーに反映する時のモード
サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。“just” はサブスクリプション期間をそのまま使用します。“rollupHour” は指定した時刻(UTC)まで延長し、日中の期限切れを回避します。
定義説明
“just”そのままサブスクリプション期間を反映
“rollupHour”次の日跨ぎ時刻まで延長してサブスクリプション期間を反映
rollupHourint{triggerExtendMode} == “rollupHour”00 ~ 23日跨ぎの時刻 (UTC)
triggerExtendMode が “rollupHour” の場合、サブスクリプション期間は有効期限日のこの時刻(0〜23、UTC)まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。
※ triggerExtendMode が “rollupHour” であれば必須
reallocateSpanDaysint300 ~ 365サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間(日)
最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。
appleAppStoreAppleAppStoreSubscriptionContentApple AppStore のコンテンツ
このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報(サブスクリプショングループID)です。
googlePlayGooglePlaySubscriptionContentGoogle Play のコンテンツ
このサブスクリプションコンテンツの Google Play のサブスクリプション情報(プロダクトID)です。

Result

説明
itemStoreSubscriptionContentModelMaster更新したストア定期課金コンテンツモデルマスター

実装例

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.UpdateStoreSubscriptionContentModelMaster(
    &money2.UpdateStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ScheduleNamespaceId: pointy.String("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName"),
        TriggerName: pointy.String("trigger-0001"),
        TriggerExtendMode: nil,
        RollupHour: nil,
        ReallocateSpanDays: pointy.Int32(45),
        AppleAppStore: &money2.AppleAppStoreSubscriptionContent{
            SubscriptionGroupIdentifier: pointy.String("21642260"),
        },
        GooglePlay: &money2.GooglePlaySubscriptionContent{
            ProductId: pointy.String("io.gs2.sample.google.product2"),
        },
    }
)
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\UpdateStoreSubscriptionContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateStoreSubscriptionContentModelMaster(
        (new UpdateStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            ->withTriggerName("trigger-0001")
            ->withTriggerExtendMode(null)
            ->withRollupHour(null)
            ->withReallocateSpanDays(45)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreSubscriptionContent())
                ->withSubscriptionGroupIdentifier("21642260"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlaySubscriptionContent())
                ->withProductId("io.gs2.sample.google.product2"))
    );
    $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.UpdateStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.UpdateStoreSubscriptionContentModelMasterResult;

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

try {
    UpdateStoreSubscriptionContentModelMasterResult result = client.updateStoreSubscriptionContentModelMaster(
        new UpdateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(45)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.UpdateStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.UpdateStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
        .WithTriggerName("trigger-0001")
        .WithTriggerExtendMode(null)
        .WithRollupHour(null)
        .WithReallocateSpanDays(45)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreSubscriptionContent()
            .WithSubscriptionGroupIdentifier("21642260"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlaySubscriptionContent()
            .WithProductId("io.gs2.sample.google.product2")),
    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.updateStoreSubscriptionContentModelMaster(
        new Gs2Money2.UpdateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(45)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new Gs2Money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    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_store_subscription_content_model_master(
        money2.UpdateStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_schedule_namespace_id('grn:ap-northeast-1:YourOwnerId:schedule:namespaceName')
            .with_trigger_name('trigger-0001')
            .with_trigger_extend_mode(None)
            .with_rollup_hour(None)
            .with_reallocate_span_days(45)
            .with_apple_app_store(
                money2.AppleAppStoreSubscriptionContent()
                    .with_subscription_group_identifier('21642260'))
            .with_google_play(
                money2.GooglePlaySubscriptionContent()
                    .with_product_id('io.gs2.sample.google.product2'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=45,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=45,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

deleteStoreSubscriptionContentModelMaster

ストア定期課金コンテンツモデルマスターを削除

指定されたストア定期課金コンテンツモデルマスターを削除します。

詳細

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring
~ 128文字ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
contentNamestring
~ 128文字ストア定期課金コンテンツモデル名

Result

説明
itemStoreSubscriptionContentModelMaster削除したストア定期課金コンテンツモデルマスター

実装例

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.DeleteStoreSubscriptionContentModelMaster(
    &money2.DeleteStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-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\DeleteStoreSubscriptionContentModelMasterRequest;

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

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->deleteStoreSubscriptionContentModelMaster(
        (new DeleteStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-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.DeleteStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.DeleteStoreSubscriptionContentModelMasterResult;

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

try {
    DeleteStoreSubscriptionContentModelMasterResult result = client.deleteStoreSubscriptionContentModelMaster(
        new DeleteStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DeleteStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.DeleteStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.DeleteStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-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.deleteStoreSubscriptionContentModelMaster(
        new Gs2Money2.DeleteStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-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.delete_store_subscription_content_model_master(
        money2.DeleteStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.delete_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.delete_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;