> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Money2 SDK API リファレンス

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



## モデル

### Namespace

ネームスペース<br>

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024文字 | ネームスペースGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  |  |  |  | トランザクション設定<br>通貨の入金・出金時に使用される分散トランザクションの設定です。 |
| currencyUsagePriority | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"PrioritizeFree",<br>&nbsp;&nbsp;"PrioritizePaid"<br>}<br> |  | ✓ |  |  | 消費優先度<br>ウォレットから出金する際に有償通貨と無償通貨のどちらを先に消費するかを決定します。"PrioritizeFree" は無償通貨を優先し、"PrioritizePaid" は有償通貨を優先します。"PrioritizeFree": 無償通貨を優先して使用する / "PrioritizePaid": 有償通貨を優先して使用する /  |
| sharedFreeCurrency | bool |  | ✓ |  |  | 無償通貨を異なるスロットで共有するか<br>有効にすると、無償通貨の残高がすべてのウォレットスロット（プラットフォーム）間で共有されます。有償通貨はスロットごとに分離されたままです。この設定はネームスペース作成時のみ設定可能で、後から変更できません。 |
| platformSetting | [PlatformSetting](#platformsetting) |  | ✓ |  |  | ストアプラットフォーム設定<br>サポートされている各ストアプラットフォーム（Apple App Store、Google Play、テスト用Fake）の設定です。各プラットフォームでのレシート検証に必要な認証情報やキーを含みます。 |
| depositBalanceScript | [ScriptSetting](#scriptsetting) |  |  |  |  | ウォレット残高を加算したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`deposit`](../script/#deposit) |
| withdrawBalanceScript | [ScriptSetting](#scriptsetting) |  |  |  |  | ウォレット残高を消費したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`withdraw`](../script/#withdraw) |
| verifyReceiptScript | [ScriptSetting](#scriptsetting) |  |  |  |  | レシート検証を実行したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`verifyReceipt`](../script/#verifyreceipt) |
| subscribeScript | string |  |  |  |  ~ 1024文字 | 期間課金を新規契約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない/一度契約失効後に再度契約した場合も呼び出される)<br>Script トリガーリファレンス - [`subscribe`](../script/#subscribe) |
| renewScript | string |  |  |  |  ~ 1024文字 | 期間課金を更新するときに実行する GS2-Script スクリプトGRN<br>Script トリガーリファレンス - [`renew`](../script/#renew) |
| unsubscribeScript | string |  |  |  |  ~ 1024文字 | 期間課金を解約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない)<br>Script トリガーリファレンス - [`unsubscribe`](../script/#unsubscribe) |
| takeOverScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 期間課金に紐づけられたユーザーを変更するときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`takeOver`](../script/#takeover) |
| changeSubscriptionStatusNotification | [NotificationSetting](#notificationsetting) |  |  |  |  | 期間課金の契約状況が変化したときのプッシュ通知<br>サブスクリプションのステータスが変化した際（有効化、更新、解約、期限切れ、取り消しなど）に GS2-Gateway を通じて配信されるプッシュ通知の設定です。ゲームクライアントがサブスクリプション状態の変化にリアルタイムで対応できるようにします。 |
| logSetting | [LogSetting](#logsetting) |  |  |  |  | ログの出力設定<br>このネームスペースに対するAPIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。入金、出金、レシート検証、サブスクリプションイベントの追跡に役立ちます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeNamespaces - ネームスペースの一覧を取得
createNamespace - ネームスペースを新規作成
getNamespace - ネームスペースを取得
updateNamespace - ネームスペースを更新
deleteNamespace - ネームスペースを削除




---

### TransactionSetting

トランザクション設定<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| enableAutoRun | bool |  |  | false |  | 発行したトランザクションをサーバーサイドで自動的に実行するか |
| enableAtomicCommit | bool | {enableAutoRun} == true |  | false |  | トランザクションの実行をアトミックにコミットするか<br>※ enableAutoRun が true であれば 有効 |
| transactionUseDistributor | bool | {enableAtomicCommit} == true |  | false |  | トランザクションを非同期処理で実行する<br>※ enableAtomicCommit が true であれば 有効 |
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true |  | false |  | スクリプトの結果コミット処理を非同期処理で実行するか<br>※ transactionUseDistributor が true であれば 有効 |
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true |  | false |  | 入手アクションを実行する際に GS2-JobQueue を使用するか<br>※ enableAtomicCommit が true であれば 有効 |
| distributorNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:distributor:default" |  ~ 1024文字 | トランザクションの実行に使用する GS2-Distributor ネームスペースGRN |
| queueNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:queue:default" |  ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペースGRN |

**関連するメソッド:**
createNamespace - ネームスペースを新規作成
updateNamespace - ネームスペースを更新


**関連するモデル:**
Namespace - ネームスペース




---

### ScriptSetting

スクリプト設定<br>

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

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

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

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



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

**関連するメソッド:**
createNamespace - ネームスペースを新規作成
updateNamespace - ネームスペースを更新


**関連するモデル:**
Namespace - ネームスペース




---

### NotificationSetting

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

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

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



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

**関連するメソッド:**
createNamespace - ネームスペースを新規作成
updateNamespace - ネームスペースを更新


**関連するモデル:**
Namespace - ネームスペース




---

### LogSetting

ログの出力設定<br>

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



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

**関連するメソッド:**
createNamespace - ネームスペースを新規作成
updateNamespace - ネームスペースを更新


**関連するモデル:**
Namespace - ネームスペース




---

### GitHubCheckoutSetting

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| apiKeyId | string |  | ✓ |  |  ~ 1024文字 | GitHub APIキーのGRN |
| repositoryName | string |  | ✓ |  |  ~ 1024文字 | リポジトリ名 |
| sourcePath | string |  | ✓ |  |  ~ 1024文字 | マスターデータ（JSON）ファイルのパス |
| referenceType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"commit_hash",<br>&nbsp;&nbsp;"branch",<br>&nbsp;&nbsp;"tag"<br>}<br> |  | ✓ |  |  | コードの取得元"commit_hash": コミットハッシュ / "branch": ブランチ / "tag": タグ /  |
| commitHash | string | {referenceType} == "commit_hash" | ✓※ |  |  ~ 1024文字 | コミットハッシュ<br>※ referenceType が "commit_hash" であれば 必須 |
| branchName | string | {referenceType} == "branch" | ✓※ |  |  ~ 1024文字 | ブランチ名<br>※ referenceType が "branch" であれば 必須 |
| tagName | string | {referenceType} == "tag" | ✓※ |  |  ~ 1024文字 | タグ名<br>※ referenceType が "tag" であれば 必須 |

**関連するメソッド:**
updateCurrentModelMasterFromGitHub - 現在アクティブなモデルのマスターデータをGitHubから更新




---

### Wallet

ウォレット<br>

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| walletId | string |  | ※ |  |  ~ 1024文字 | ウォレットGRN<br>※ サーバーが自動で設定 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| slot | int |  | ✓ |  | 0 ~ 100000000 | スロット番号<br>ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます（例：iOS用とAndroid用）。 |
| summary | [WalletSummary](#walletsummary) |  | ✓ |  |  | ウォレットの状態<br>ウォレットの現在の残高サマリーで、有償通貨、無償通貨、合計額に分けて表示されます。入金トランザクションから算出されます。 |
| depositTransactions | [List&lt;DepositTransaction&gt;](#deposittransaction) |  |  | [] | 0 ~ 1000 items | 入金トランザクションリスト<br>このウォレットへの全入金の記録です。各トランザクションは購入価格、通貨コード、数量、入金日時を追跡します。有償の入金（価格 > 0）は返金計算や法規制対応のために単価ごとに管理されます。 |
| sharedFreeCurrency | bool |  | ✓ |  |  | 無償通貨を共有するか<br>このウォレットの無償通貨がすべてのスロット間で共有されるかどうかを示します。ウォレット作成時にネームスペースの設定から継承されます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeWallets - ウォレット一覧を取得
describeWalletsByUserId - ユーザーIDを指定してウォレット一覧を取得
getWallet - ウォレットを取得
getWalletByUserId - ユーザーIDを指定してウォレットを取得
depositByUserId - ユーザーIDを指定してウォレットの残高に加算
withdraw - ウォレットから残高を消費
withdrawByUserId - ユーザーIDを指定してウォレットから残高を消費




---

### Event

イベント<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| eventId | string |  | ※ |  |  ~ 1024文字 | イベントGRN<br>※ サーバーが自動で設定 |
| transactionId | string |  | ✓ |  |  ~ 1024文字 | トランザクションID<br>この決済イベントの一意の識別子です。レシート検証イベントの場合はストアプラットフォームのトランザクションIDに対応します。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| eventType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"VerifyReceipt",<br>&nbsp;&nbsp;"Deposit",<br>&nbsp;&nbsp;"Withdraw",<br>&nbsp;&nbsp;"Refund"<br>}<br> |  | ✓ |  |  | イベントの種類<br>決済イベントの種類です。"VerifyReceipt" はストアのレシート検証を、"Deposit" は通貨の追加を、"Withdraw" は通貨の消費を、"Refund" は返金処理を記録します。"VerifyReceipt": レシート検証 / "Deposit": 加算 / "Withdraw": 消費 / "Refund": 返金済み /  |
| verifyReceiptEvent | [VerifyReceiptEvent](#verifyreceiptevent) |  |  |  |  | レシート検証イベント<br>レシート検証イベントの詳細です。eventType が "VerifyReceipt" の場合に設定されます。ストアコンテンツ名、プラットフォーム、プラットフォーム固有の検証結果を含みます。 |
| depositEvent | [DepositEvent](#depositevent) |  |  |  |  | 入金イベント<br>入金イベントの詳細です。eventType が "Deposit" の場合に設定されます。ウォレットスロット、入金トランザクション、入金後のウォレット状態を含みます。 |
| withdrawEvent | [WithdrawEvent](#withdrawevent) |  |  |  |  | 出金イベント<br>出金イベントの詳細です。eventType が "Withdraw" の場合に設定されます。ウォレットスロット、出金の詳細、出金後のウォレット状態を含みます。 |
| refundEvent | [RefundEvent](#refundevent) |  |  |  |  | 返金イベント<br>返金イベントの詳細です。eventType が "Refund" の場合に設定されます。ストアコンテンツ名、プラットフォーム、プラットフォーム固有の返金情報を含みます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeEventsByUserId - イベントの一覧を取得
getEventByTransactionId - トランザクションIDを指定してイベントを取得
verifyReceipt - レシートを使用済み化
verifyReceiptByUserId - ユーザーIDを指定してレシートを使用済み化




---

### SubscribeTransaction

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| subscribeTransactionId | string |  | ※ |  |  ~ 1024文字 | サブスクリプショントランザクションGRN<br>※ サーバーが自動で設定 |
| contentName | string |  | ✓ |  |  ~ 128文字 | ストア定期課金コンテンツモデル名 |
| transactionId | string |  | ✓ |  |  ~ 1024文字 | トランザクションID<br>ストアプラットフォームによって割り当てられた一意のトランザクション識別子です。同一購入の重複処理を防止するために使用されます。 |
| store | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"AppleAppStore",<br>&nbsp;&nbsp;"GooglePlay",<br>&nbsp;&nbsp;"fake"<br>}<br> |  | ✓ |  |  | ストア<br>購入が行われたストアプラットフォームです。レシート検証に使用される検証方法を決定します。"AppleAppStore": Apple App Store / "GooglePlay": Google Play / "fake": Fake /  |
| userId | string |  |  |  |  ~ 128文字 | ユーザーID |
| statusDetail | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"active@active",<br>&nbsp;&nbsp;"active@converted_from_trial",<br>&nbsp;&nbsp;"active@in_trial",<br>&nbsp;&nbsp;"active@in_intro_offer",<br>&nbsp;&nbsp;"grace@canceled",<br>&nbsp;&nbsp;"grace@grace_period",<br>&nbsp;&nbsp;"grace@on_hold",<br>&nbsp;&nbsp;"inactive@expired",<br>&nbsp;&nbsp;"inactive@revoked"<br>}<br> |  | ✓ |  |  | ステータス<br>詳細なサブスクリプションステータスです。簡易カテゴリ（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": 払い戻しなどで強制的にキャンセルされた /  |
| expiresAt | long |  | ✓ |  |  | 有効期限<br>このサブスクリプショントランザクションが期限切れになる日時です。ストアプラットフォームによってサブスクリプションが更新されると更新されます。 |
| lastAllocatedAt | long |  |  |  |  | 最後にユーザーに割り当てられた日時<br>このサブスクリプショントランザクションが最後にユーザーに割り当てられた日時です。reallocateSpanDays と組み合わせて、サブスクリプションを別のユーザーに再割り当て可能かどうかを判定するために使用されます。 |
| lastTakeOverAt | long |  |  |  |  | 最後に対象ユーザーが切り替えられた日時<br>このサブスクリプションに紐づくユーザーが最後に変更（引き継ぎ）された日時です。サブスクリプションのアカウント移行履歴を追跡します。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するモデル:**
SubscriptionStatus - サブスクリプションの契約状況




---

### SubscriptionStatus

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

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



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

**関連するメソッド:**
describeSubscriptionStatuses - サブスクリプションの契約状況の一覧を取得
describeSubscriptionStatusesByUserId - ユーザーIDを指定してサブスクリプションの契約状況の一覧を取得
getSubscriptionStatus - サブスクリプションの契約状況を取得
getSubscriptionStatusByUserId - ユーザーIDを指定してサブスクリプションの契約状況を取得
allocateSubscriptionStatus - レシートからサブスクリプションの契約状況を割り当て
allocateSubscriptionStatusByUserId - ユーザーIDを指定してレシートからサブスクリプションの契約状況を割り当て
takeoverSubscriptionStatus - すでに他のユーザーに割り当てられているサブスクリプションの契約状況を引き継ぐ
takeoverSubscriptionStatusByUserId - ユーザーIDを指定してすでに他のユーザーに割り当てられているサブスクリプションの契約状況を引き継ぐ




---

### RefundHistory

返金履歴情報<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| refundHistoryId | string |  | ※ |  |  ~ 1024文字 | サブスクリプショントランザクションGRN<br>※ サーバーが自動で設定 |
| transactionId | string |  | ✓ |  |  ~ 1024文字 | トランザクションID<br>ストアプラットフォームによって割り当てられた一意のトランザクション識別子です。同一購入の重複処理を防止するために使用されます。 |
| year | int |  | ✓ |  | 2000 ~ 3000 | 年 |
| month | int |  | ✓ |  | 1 ~ 12 | 月 |
| day | int |  | ✓ |  | 1 ~ 31 | 日 |
| userId | string |  |  |  |  ~ 128文字 | ユーザーID |
| detail | [RefundEvent](#refundevent) |  | ✓ |  |  | 返金イベント情報 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |

**関連するメソッド:**
describeRefundHistoriesByUserId - ユーザーIDを指定して返金履歴情報の一覧を取得
describeRefundHistoriesByDate - 年と月を指定して返金履歴情報の一覧を取得
getRefundHistory - トランザクションIDを指定して返金履歴情報を取得




---

### DailyTransactionHistory

日々の取引履歴<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| dailyTransactionHistoryId | string |  | ※ |  |  ~ 1024文字 | 日々の取引履歴GRN<br>※ サーバーが自動で設定 |
| year | int |  | ✓ |  | 2000 ~ 3000 | 年 |
| month | int |  | ✓ |  | 1 ~ 12 | 月 |
| day | int |  | ✓ |  | 1 ~ 31 | 日 |
| currency | string |  | ✓ |  |  ~ 8文字 | 通貨コード |
| depositAmount | double |  |  | 0 | 0 ~ 281474976710654 | 売り上げ総額<br>この日に入金された実金額（売上）の合計で、指定された通貨建てです。 |
| withdrawAmount | double |  |  | 0 | 0 ~ 281474976710654 | 消費総額<br>この日に消費（出金）された通貨の実金額換算の合計で、消費された各入金トランザクションの単価から算出されます。 |
| issueCount | long |  |  | 0 | 0 ~ 9223372036854775805 | 発行数量<br>この日に入金（発行）された仮想通貨の総単位数で、有償通貨と無償通貨の両方を含みます。 |
| consumeCount | long |  |  | 0 | 0 ~ 9223372036854775805 | 消費数量<br>この日に消費（出金）された仮想通貨の総単位数です。 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeDailyTransactionHistoriesByCurrency - 通貨を指定して日々の取引履歴の一覧を取得
describeDailyTransactionHistories - 日々の取引履歴の一覧を取得
getDailyTransactionHistory - 日付と通貨を指定して日々の取引履歴を取得




---

### UnusedBalance

未使用残高<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| unusedBalanceId | string |  | ※ |  |  ~ 1024文字 | 未使用残高GRN<br>※ サーバーが自動で設定 |
| currency | string |  | ✓ |  |  ~ 8文字 | 通貨コード<br>未使用残高が追跡されるISO通貨コード（例："JPY"、"USD"）です。 |
| balance | double |  | ✓ |  | 0 ~ 16777214 | 未使用残高<br>全ユーザーにわたる有償通貨の未使用総額で、指定された通貨建てです。資金決済法およびそれに類する規制への準拠に使用されます。 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeUnusedBalances - 未使用残高の一覧を取得
getUnusedBalance - 通貨を指定して未使用残高を取得




---

### StoreContentModel

ストアコンテンツモデル<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| storeContentModelId | string |  | ※ |  |  ~ 1024文字 | ストアコンテンツモデルGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | ストアコンテンツモデル名 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| appleAppStore | [AppleAppStoreContent](#appleappstorecontent) |  |  |  |  | Apple App Store のコンテンツ<br>このストアコンテンツの Apple App Store 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |
| googlePlay | [GooglePlayContent](#googleplaycontent) |  |  |  |  | Google Play のコンテンツ<br>このストアコンテンツの Google Play 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |

**関連するメソッド:**
describeStoreContentModels - ストアコンテンツモデルの一覧を取得
getStoreContentModel - ストアコンテンツモデルを取得




---

### StoreSubscriptionContentModel

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| storeSubscriptionContentModelId | string |  | ※ |  |  ~ 1024文字 | 期間課金コンテンツモデルGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | ストア定期課金コンテンツモデル名 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ |
| scheduleNamespaceId | string |  | ✓ |  |  ~ 1024文字 | サブスクリプション期間を連動させる GS2-Schedule のネームスペースGRN |
| triggerName | string |  | ✓ |  |  ~ 128文字 | サブスクリプション期間を反映するトリガー名<br>サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。 |
| triggerExtendMode | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"just",<br>&nbsp;&nbsp;"rollupHour"<br>}<br> |  |  | "just" |  | サブスクリプション期間をトリガーに反映する時のモード<br>サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。"just" はサブスクリプション期間をそのまま使用します。"rollupHour" は指定した時刻（UTC）まで延長し、日中の期限切れを回避します。"just": そのままサブスクリプション期間を反映 / "rollupHour": 次の日跨ぎ時刻まで延長してサブスクリプション期間を反映 /  |
| rollupHour | int | {triggerExtendMode} == "rollupHour" |  | 0 | 0 ~ 23 | 日跨ぎの時刻 (UTC)<br>triggerExtendMode が "rollupHour" の場合、サブスクリプション期間は有効期限日のこの時刻（0〜23、UTC）まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。<br>※ triggerExtendMode が "rollupHour" であれば 有効 |
| reallocateSpanDays | int |  |  | 30 | 0 ~ 365 | サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間（日）<br>最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。 |
| appleAppStore | [AppleAppStoreSubscriptionContent](#appleappstoresubscriptioncontent) |  |  |  |  | Apple App Store のコンテンツ<br>このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報（サブスクリプショングループID）です。 |
| googlePlay | [GooglePlaySubscriptionContent](#googleplaysubscriptioncontent) |  |  |  |  | Google Play のコンテンツ<br>このサブスクリプションコンテンツの Google Play のサブスクリプション情報（プロダクトID）です。 |

**関連するメソッド:**
describeStoreSubscriptionContentModels - ストア定期課金コンテンツモデルの一覧を取得
getStoreSubscriptionContentModel - ストア定期課金コンテンツモデルを取得




---

### Receipt

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

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



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

**関連するメソッド:**
verifyReceipt - レシートを使用済み化
verifyReceiptByUserId - ユーザーIDを指定してレシートを使用済み化




---

### PlatformSetting

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| appleAppStore | [AppleAppStoreSetting](#appleappstoresetting) |  |  |  |  | Apple App Store の設定<br>Apple App Store のレシート検証に使用する認証情報です。バンドルID、共有秘密鍵、Issuer ID、キーID、秘密鍵を含みます。 |
| googlePlay | [GooglePlaySetting](#googleplaysetting) |  |  |  |  | Google Play の設定<br>Google Play のレシート検証に使用する認証情報です。パッケージ名と署名検証用の公開鍵を含みます。 |
| fake | [FakeSetting](#fakesetting) |  |  |  |  | Fake (Unity Editor) の設定<br>開発・テスト中に Unity Editor が生成するフェイクレシートの受け入れに関する設定です。 |

**関連するメソッド:**
createNamespace - ネームスペースを新規作成
updateNamespace - ネームスペースを更新


**関連するモデル:**
Namespace - ネームスペース




---

### AppleAppStoreSetting

Apple App Store の設定<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| bundleId | string |  |  |  |  ~ 1024文字 | Apple App Store のバンドルID |
| sharedSecretKey | string |  |  |  |  ~ 1024文字 | AppStore Connect で発行したレシートの暗号化に使用する共有秘密鍵 |
| issuerId | string |  |  |  |  ~ 1024文字 | AppStore Connect で登録したアプリ内課金の Issuer ID |
| keyId | string |  |  |  |  ~ 1024文字 | Apple に登録済みのキーID |
| privateKeyPem | string |  |  |  |  ~ 10240文字 | Apple から受け取った秘密鍵 |

**関連するモデル:**
PlatformSetting - ストアプラットフォームの設定




---

### GooglePlaySetting

Google Play の設定<br>

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



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

**関連するモデル:**
PlatformSetting - ストアプラットフォームの設定




---

### FakeSetting

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

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



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

**関連するモデル:**
PlatformSetting - ストアプラットフォームの設定




---

### WalletSummary

ウォレットの状態<br>

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



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

**関連するモデル:**
Wallet - ウォレット
DepositEvent - 入金イベント
WithdrawEvent - 出金イベント




---

### DepositTransaction

入金トランザクション<br>

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



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

**関連するメソッド:**
withdraw - ウォレットから残高を消費
withdrawByUserId - ユーザーIDを指定してウォレットから残高を消費


**関連するモデル:**
Wallet - ウォレット
DepositEvent - 入金イベント
WithdrawEvent - 出金イベント




---

### VerifyReceiptEvent

レシート検証イベント<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| contentName | string |  | ✓ |  |  ~ 128文字 | ストアコンテンツモデル名 |
| platform | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"AppleAppStore",<br>&nbsp;&nbsp;"GooglePlay",<br>&nbsp;&nbsp;"fake"<br>}<br> |  | ✓ |  |  | ストアプラットフォーム<br>レシートが発行されたストアプラットフォームです。どの検証フローが使用されたかを決定します。"AppleAppStore": Apple App Store / "GooglePlay": Google Play / "fake": Fake /  |
| appleAppStoreVerifyReceiptEvent | [AppleAppStoreVerifyReceiptEvent](#appleappstoreverifyreceiptevent) |  |  |  |  | Apple App Store のレシート検証イベント<br>Apple App Store からの検証結果です。環境（sandbox または production）情報を含みます。platform が "AppleAppStore" の場合に設定されます。 |
| googlePlayVerifyReceiptEvent | [GooglePlayVerifyReceiptEvent](#googleplayverifyreceiptevent) |  |  |  |  | Google Play のレシート検証イベント<br>Google Play からの検証結果です。購入トークンを含みます。platform が "GooglePlay" の場合に設定されます。 |

**関連するモデル:**
Event - イベント




---

### DepositEvent

入金イベント<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| slot | int |  | ✓ |  | 0 ~ 100000000 | スロット番号<br>ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます（例：iOS用とAndroid用）。 |
| depositTransactions | [List&lt;DepositTransaction&gt;](#deposittransaction) |  |  | [] | 0 ~ 1000 items | 入金トランザクションリスト<br>このイベントでウォレットに追加された入金トランザクションです。 |
| status | [WalletSummary](#walletsummary) |  | ✓ |  |  | ウォレットの状態<br>入金が適用された後のウォレットの残高サマリー（有償、無償、合計）です。 |

**関連するモデル:**
Event - イベント




---

### WithdrawEvent

出金イベント<br>

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



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

**関連するモデル:**
Event - イベント




---

### RefundEvent

返金イベント<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| contentName | string |  | ✓ |  |  ~ 128文字 | ストアコンテンツモデル名 |
| platform | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"AppleAppStore",<br>&nbsp;&nbsp;"GooglePlay",<br>&nbsp;&nbsp;"fake"<br>}<br> |  | ✓ |  |  | ストアプラットフォーム<br>返金が発行されたストアプラットフォームです。"AppleAppStore": Apple App Store / "GooglePlay": Google Play / "fake": Fake /  |
| appleAppStoreRefundEvent | [AppleAppStoreVerifyReceiptEvent](#appleappstoreverifyreceiptevent) |  |  |  |  | Apple App Store のレシート検証イベント |
| googlePlayRefundEvent | [GooglePlayVerifyReceiptEvent](#googleplayverifyreceiptevent) |  |  |  |  | Google Play のレシート検証イベント |

**関連するモデル:**
Event - イベント
RefundHistory - 返金履歴情報




---

### AppleAppStoreVerifyReceiptEvent

Apple App Store のレシート<br>

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| environment | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"sandbox",<br>&nbsp;&nbsp;"production"<br>}<br> |  | ✓ |  |  | 環境<br>レシートが生成された Apple App Store の環境です。"sandbox" はテスト購入を、"production" は実際の購入を示します。"sandbox": Sandbox / "production": Production /  |

**関連するモデル:**
VerifyReceiptEvent - レシート検証イベント
RefundEvent - 返金イベント




---

### GooglePlayVerifyReceiptEvent

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

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



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

**関連するモデル:**
VerifyReceiptEvent - レシート検証イベント
RefundEvent - 返金イベント




---

### AppleAppStoreContent

Apple App Store のコンテンツ<br>

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



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

**関連するメソッド:**
createStoreContentModelMaster - ストアコンテンツマスターを新規作成
updateStoreContentModelMaster - ストアコンテンツマスターを更新


**関連するモデル:**
StoreContentModel - ストアコンテンツモデル
StoreContentModelMaster - ストアコンテンツモデルマスター




---

### GooglePlayContent

Google Play のコンテンツ<br>

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



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

**関連するメソッド:**
createStoreContentModelMaster - ストアコンテンツマスターを新規作成
updateStoreContentModelMaster - ストアコンテンツマスターを更新


**関連するモデル:**
StoreContentModel - ストアコンテンツモデル
StoreContentModelMaster - ストアコンテンツモデルマスター




---

### AppleAppStoreSubscriptionContent

Apple App Store の期間課金コンテンツ<br>

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



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

**関連するメソッド:**
createStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを新規作成
updateStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを更新


**関連するモデル:**
StoreSubscriptionContentModel - ストア定期課金コンテンツモデル
StoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスター




---

### GooglePlaySubscriptionContent

Google Play の期間課金コンテンツ<br>

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



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

**関連するメソッド:**
createStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを新規作成
updateStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを更新


**関連するモデル:**
StoreSubscriptionContentModel - ストア定期課金コンテンツモデル
StoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスター




---

### GooglePlayRealtimeNotificationMessage

RTDN メッセージ<br>

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



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



---

### CurrentModelMaster

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

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

JSONファイルを作成する方法として、マネージメントコンソール内にマスターデータエディタを提供しています。<br>
また、よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
{{% alert title="Note" color="info" %}}
JSONファイルの形式については [GS2-Money2 マスターデータリファレンス](api_reference/money2/master_data/) をご参照ください。
{{% /alert %}}



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024文字 | ネームスペースGRN<br>※ サーバーが自動で設定 |
| settings | string |  | ✓ |  |  ~ 5242880 バイト (5MB) | マスターデータ |

**関連するメソッド:**
exportMaster - モデルマスターを有効化可能なマスターデータ形式でエクスポート
getCurrentModelMaster - 現在アクティブなモデルのマスターデータを取得
updateCurrentModelMaster - 現在アクティブなモデルのマスターデータを更新
updateCurrentModelMasterFromGitHub - 現在アクティブなモデルのマスターデータをGitHubから更新




---

### StoreContentModelMaster

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| storeContentModelId | string |  | ※ |  |  ~ 1024文字 | コンテンツモデルマスターGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | ストアコンテンツモデル名 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ |
| appleAppStore | [AppleAppStoreContent](#appleappstorecontent) |  |  |  |  | Apple App Store のコンテンツ<br>このストアコンテンツの Apple App Store 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |
| googlePlay | [GooglePlayContent](#googleplaycontent) |  |  |  |  | Google Play のコンテンツ<br>このストアコンテンツの Google Play 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeStoreContentModelMasters - ストアコンテンツモデルマスターの一覧を取得
createStoreContentModelMaster - ストアコンテンツマスターを新規作成
getStoreContentModelMaster - ストアコンテンツマスターを取得
updateStoreContentModelMaster - ストアコンテンツマスターを更新
deleteStoreContentModelMaster - ストアコンテンツマスターを削除




---

### StoreSubscriptionContentModelMaster

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| storeSubscriptionContentModelId | string |  | ※ |  |  ~ 1024文字 | 期間課金コンテンツモデルマスターGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | ストア定期課金コンテンツモデル名 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ |
| scheduleNamespaceId | string |  | ✓ |  |  ~ 1024文字 | サブスクリプション期間を連動させる GS2-Schedule のネームスペースGRN |
| triggerName | string |  | ✓ |  |  ~ 128文字 | サブスクリプション期間を反映するトリガー名<br>サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。 |
| reallocateSpanDays | int |  |  | 30 | 0 ~ 365 | サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間（日）<br>最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。 |
| triggerExtendMode | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"just",<br>&nbsp;&nbsp;"rollupHour"<br>}<br> |  |  | "just" |  | サブスクリプション期間をトリガーに反映する時のモード<br>サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。"just" はサブスクリプション期間をそのまま使用します。"rollupHour" は指定した時刻（UTC）まで延長し、日中の期限切れを回避します。"just": そのままサブスクリプション期間を反映 / "rollupHour": 次の日跨ぎ時刻まで延長してサブスクリプション期間を反映 /  |
| rollupHour | int | {triggerExtendMode} == "rollupHour" |  | 0 | 0 ~ 23 | 日跨ぎの時刻 (UTC)<br>triggerExtendMode が "rollupHour" の場合、サブスクリプション期間は有効期限日のこの時刻（0〜23、UTC）まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。<br>※ triggerExtendMode が "rollupHour" であれば 有効 |
| appleAppStore | [AppleAppStoreSubscriptionContent](#appleappstoresubscriptioncontent) |  |  |  |  | Apple App Store のコンテンツ<br>このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報（サブスクリプショングループID）です。 |
| googlePlay | [GooglePlaySubscriptionContent](#googleplaysubscriptioncontent) |  |  |  |  | Google Play のコンテンツ<br>このサブスクリプションコンテンツの Google Play のサブスクリプション情報（プロダクトID）です。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeStoreSubscriptionContentModelMasters - ストア定期課金コンテンツモデルマスターの一覧を取得
createStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを新規作成
getStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを取得
updateStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを更新
deleteStoreSubscriptionContentModelMaster - ストア定期課金コンテンツモデルマスターを削除




---
## メソッド

### describeNamespaces

ネームスペースの一覧を取得<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namePrefix | string |  | |  |  ~ 64文字 | ネームスペース名のフィルター接頭辞 |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;Namespace&gt;](#namespace) | ネームスペースのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ネームスペースを新規作成<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| currencyUsagePriority | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"PrioritizeFree",<br>&nbsp;&nbsp;"PrioritizePaid"<br>}<br> |  | ✓|  |  | 消費優先度<br>ウォレットから出金する際に有償通貨と無償通貨のどちらを先に消費するかを決定します。"PrioritizeFree" は無償通貨を優先し、"PrioritizePaid" は有償通貨を優先します。"PrioritizeFree": 無償通貨を優先して使用する / "PrioritizePaid": 有償通貨を優先して使用する /  |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | トランザクション設定<br>通貨の入金・出金時に使用される分散トランザクションの設定です。 |
| sharedFreeCurrency | bool |  | ✓|  |  | 無償通貨を異なるスロットで共有するか<br>有効にすると、無償通貨の残高がすべてのウォレットスロット（プラットフォーム）間で共有されます。有償通貨はスロットごとに分離されたままです。この設定はネームスペース作成時のみ設定可能で、後から変更できません。 |
| platformSetting | [PlatformSetting](#platformsetting) |  | ✓|  |  | ストアプラットフォーム設定<br>サポートされている各ストアプラットフォーム（Apple App Store、Google Play、テスト用Fake）の設定です。各プラットフォームでのレシート検証に必要な認証情報やキーを含みます。 |
| depositBalanceScript | [ScriptSetting](#scriptsetting) |  | |  |  | ウォレット残高を加算したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`deposit`](../script/#deposit) |
| withdrawBalanceScript | [ScriptSetting](#scriptsetting) |  | |  |  | ウォレット残高を消費したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`withdraw`](../script/#withdraw) |
| verifyReceiptScript | [ScriptSetting](#scriptsetting) |  | |  |  | レシート検証を実行したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`verifyReceipt`](../script/#verifyreceipt) |
| subscribeScript | string |  | |  |  ~ 1024文字 | 期間課金を新規契約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない/一度契約失効後に再度契約した場合も呼び出される)<br>Script トリガーリファレンス - [`subscribe`](../script/#subscribe) |
| renewScript | string |  | |  |  ~ 1024文字 | 期間課金を更新するときに実行する GS2-Script スクリプトGRN<br>Script トリガーリファレンス - [`renew`](../script/#renew) |
| unsubscribeScript | string |  | |  |  ~ 1024文字 | 期間課金を解約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない)<br>Script トリガーリファレンス - [`unsubscribe`](../script/#unsubscribe) |
| takeOverScript | [ScriptSetting](#scriptsetting) |  | |  |  | 期間課金に紐づけられたユーザーを変更するときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`takeOver`](../script/#takeover) |
| changeSubscriptionStatusNotification | [NotificationSetting](#notificationsetting) |  | |  |  | 期間課金の契約状況が変化したときのプッシュ通知<br>サブスクリプションのステータスが変化した際（有効化、更新、解約、期限切れ、取り消しなど）に GS2-Gateway を通じて配信されるプッシュ通知の設定です。ゲームクライアントがサブスクリプション状態の変化にリアルタイムで対応できるようにします。 |
| logSetting | [LogSetting](#logsetting) |  | |  |  | ログの出力設定<br>このネームスペースに対するAPIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。入金、出金、レシート検証、サブスクリプションイベントの追跡に役立ちます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Namespace](#namespace) | 作成したネームスペース |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ネームスペースの状態を取得<br>

指定されたネームスペースの現在の状態を取得します。<br>
これには、ネームスペースがアクティブか、保留中か、またはその他の状態にあるかが含まれます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| status | string |  |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ネームスペースを取得<br>

指定されたネームスペースの詳細情報を取得します。<br>
これには、ネームスペースの名前、説明、およびその他の設定情報が含まれます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Namespace](#namespace) | ネームスペース |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ネームスペースを更新<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| currencyUsagePriority | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"PrioritizeFree",<br>&nbsp;&nbsp;"PrioritizePaid"<br>}<br> |  | ✓|  |  | 消費優先度<br>ウォレットから出金する際に有償通貨と無償通貨のどちらを先に消費するかを決定します。"PrioritizeFree" は無償通貨を優先し、"PrioritizePaid" は有償通貨を優先します。"PrioritizeFree": 無償通貨を優先して使用する / "PrioritizePaid": 有償通貨を優先して使用する /  |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | トランザクション設定<br>通貨の入金・出金時に使用される分散トランザクションの設定です。 |
| platformSetting | [PlatformSetting](#platformsetting) |  | ✓|  |  | ストアプラットフォーム設定<br>サポートされている各ストアプラットフォーム（Apple App Store、Google Play、テスト用Fake）の設定です。各プラットフォームでのレシート検証に必要な認証情報やキーを含みます。 |
| depositBalanceScript | [ScriptSetting](#scriptsetting) |  | |  |  | ウォレット残高を加算したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`deposit`](../script/#deposit) |
| withdrawBalanceScript | [ScriptSetting](#scriptsetting) |  | |  |  | ウォレット残高を消費したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`withdraw`](../script/#withdraw) |
| verifyReceiptScript | [ScriptSetting](#scriptsetting) |  | |  |  | レシート検証を実行したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`verifyReceipt`](../script/#verifyreceipt) |
| subscribeScript | string |  | |  |  ~ 1024文字 | 期間課金を新規契約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない/一度契約失効後に再度契約した場合も呼び出される)<br>Script トリガーリファレンス - [`subscribe`](../script/#subscribe) |
| renewScript | string |  | |  |  ~ 1024文字 | 期間課金を更新するときに実行する GS2-Script スクリプトGRN<br>Script トリガーリファレンス - [`renew`](../script/#renew) |
| unsubscribeScript | string |  | |  |  ~ 1024文字 | 期間課金を解約するときに実行する GS2-Script スクリプトGRN(ユーザーの紐づけ変更時には呼び出されない)<br>Script トリガーリファレンス - [`unsubscribe`](../script/#unsubscribe) |
| takeOverScript | [ScriptSetting](#scriptsetting) |  | |  |  | 期間課金に紐づけられたユーザーを変更するときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`takeOver`](../script/#takeover) |
| changeSubscriptionStatusNotification | [NotificationSetting](#notificationsetting) |  | |  |  | 期間課金の契約状況が変化したときのプッシュ通知<br>サブスクリプションのステータスが変化した際（有効化、更新、解約、期限切れ、取り消しなど）に GS2-Gateway を通じて配信されるプッシュ通知の設定です。ゲームクライアントがサブスクリプション状態の変化にリアルタイムで対応できるようにします。 |
| logSetting | [LogSetting](#logsetting) |  | |  |  | ログの出力設定<br>このネームスペースに対するAPIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。入金、出金、レシート検証、サブスクリプションイベントの追跡に役立ちます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Namespace](#namespace) | 更新したネームスペース |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ネームスペースを削除<br>

指定されたネームスペースを削除します。<br>
この操作は不可逆であり、削除されたネームスペースに関連するすべてのデータは回復不能になります。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Namespace](#namespace) | 削除したネームスペース |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

リクエストパラメータ: なし

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | string | バージョン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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に紐づくデータのダンプを取得<br>

個人情報保護の法的要件を満たすために使用したり、データのバックアップや移行に使用できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |

#### 実装例




**Go**
```go

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")
}

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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

```

**GS2-Script(Async)**
```lua

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

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| url | string | 出力データのURL |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ユーザーデータの完全削除<br>

指定されたユーザーIDに紐づくデータのクリーニングを実行します。<br>
これにより、特定のユーザーデータをプロジェクトから安全に削除できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |

#### 実装例




**Go**
```go

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")
}

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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

```

**GS2-Script(Async)**
```lua

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

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |

#### 実装例




**Go**
```go

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")
}

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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

```

**GS2-Script(Async)**
```lua

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に紐づくデータのインポートを準備<br>

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

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

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

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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に紐づくデータのインポートを実行<br>

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |

#### 実装例




**Go**
```go

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")
}

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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

```

**GS2-Script(Async)**
```lua

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

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| url | string | 出力ログのURL |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ウォレット一覧を取得<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;Wallet&gt;](#wallet) | ウォレットのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してウォレット一覧を取得<br>

指定されたユーザーのウォレットのページネーション付きリストを取得します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;Wallet&gt;](#wallet) | ウォレットのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ウォレットを取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Wallet](#wallet) | ウォレット |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してウォレットを取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Wallet](#wallet) | ウォレット |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してウォレットの残高に加算<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| slot | int |  | ✓|  | 0 ~ 100000000 | スロット番号<br>ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます（例：iOS用とAndroid用）。 |
| depositTransactions | [List&lt;DepositTransaction&gt;](#deposittransaction) |  | ✓|  | 1 ~ 1000 items | 入金トランザクションリスト |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Wallet](#wallet) | 加算後のウォレット |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| slot | int |  | ✓|  | 0 ~ 100000000 | スロット番号<br>ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます（例：iOS用とAndroid用）。 |
| withdrawCount | int |  | ✓|  | 1 ~ 2147483646 | 消費する課金通貨の数量 |
| paidOnly | bool |  | | false |  | 有償通貨のみを対象とするか |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Wallet](#wallet) | 消費後のウォレット |
| withdrawTransactions | [List&lt;DepositTransaction&gt;](#deposittransaction) | 消費した入金トランザクションリスト |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してウォレットから残高を消費<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| slot | int |  | ✓|  | 0 ~ 100000000 | スロット番号<br>ウォレットスロットを識別します。プラットフォーム間の残高共有が許可されていない場合、異なるスロットを使用してプラットフォームごとに通貨を分けて管理できます（例：iOS用とAndroid用）。 |
| withdrawCount | int |  | ✓|  | 1 ~ 2147483646 | 消費する課金通貨の数量 |
| paidOnly | bool |  | | false |  | 有償通貨のみを対象とするか |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Wallet](#wallet) | 消費後のウォレット |
| withdrawTransactions | [List&lt;DepositTransaction&gt;](#deposittransaction) | 消費した入金トランザクションリスト |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

イベントの一覧を取得<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| begin | long |  | | 現在時刻から30日前の絶対時刻 |  | 検索開始日時 |
| end | long |  | | 現在時刻 |  | 検索終了日時 |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;Event&gt;](#event) | イベントのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してイベントを取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Event](#event) | イベント |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

レシートを使用済み化<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| contentName | string |  | ✓|  |  ~ 128文字 | ストアコンテンツモデル名 |
| receipt | [Receipt](#receipt) |  | ✓|  |  | レシート |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Event](#event) | イベント |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してレシートを使用済み化<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| contentName | string |  | ✓|  |  ~ 128文字 | ストアコンテンツモデル名 |
| receipt | [Receipt](#receipt) |  | ✓|  |  | レシート |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Event](#event) | イベント |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscriptionStatus&gt;](#subscriptionstatus) | サブスクリプションの契約状況のリスト |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してサブスクリプションの契約状況の一覧を取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscriptionStatus&gt;](#subscriptionstatus) | サブスクリプションの契約状況のリスト |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscriptionStatus](#subscriptionstatus) | サブスクリプションの契約状況 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してサブスクリプションの契約状況を取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscriptionStatus](#subscriptionstatus) | サブスクリプションの契約状況 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscriptionStatus](#subscriptionstatus) | サブスクリプションの契約状況 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してレシートからサブスクリプションの契約状況を割り当て<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscriptionStatus](#subscriptionstatus) | サブスクリプションの契約状況 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscriptionStatus](#subscriptionstatus) | サブスクリプションの契約状況 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定してすでに他のユーザーに割り当てられているサブスクリプションの契約状況を引き継ぐ<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscriptionStatus](#subscriptionstatus) | サブスクリプションの契約状況 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定して返金履歴情報の一覧を取得<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | |  |  ~ 128文字 | ユーザーID |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;RefundHistory&gt;](#refundhistory) | 返金履歴情報のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| year | int |  | ✓|  | 2000 ~ 3000 | 年 |
| month | int |  | ✓|  | 1 ~ 12 | 月 |
| day | int |  | |  | 1 ~ 31 | 日 |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;RefundHistory&gt;](#refundhistory) | 返金履歴情報のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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を指定して返金履歴情報を取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [RefundHistory](#refundhistory) | 返金履歴情報 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| currency | string |  | ✓|  |  ~ 8文字 | 通貨コード |
| year | int |  | ✓|  | 2000 ~ 3000 | 年 |
| month | int |  | |  | 1 ~ 12 | 月 |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;DailyTransactionHistory&gt;](#dailytransactionhistory) | 日々の取引履歴のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

日々の取引履歴の一覧を取得<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| year | int |  | ✓|  | 2000 ~ 3000 | 年 |
| month | int |  | |  | 1 ~ 12 | 月 |
| day | int | {month} > 0 | |  | 1 ~ 31 | 日 |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;DailyTransactionHistory&gt;](#dailytransactionhistory) | 日々の取引履歴のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| year | int |  | ✓|  | 2000 ~ 3000 | 年 |
| month | int |  | ✓|  | 1 ~ 12 | 月 |
| day | int |  | ✓|  | 1 ~ 31 | 日 |
| currency | string |  | ✓|  |  ~ 8文字 | 通貨コード |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [DailyTransactionHistory](#dailytransactionhistory) | 日々の取引履歴 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

未使用残高の一覧を取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;UnusedBalance&gt;](#unusedbalance) | 未使用残高のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [UnusedBalance](#unusedbalance) | 未使用残高 |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;StoreContentModel&gt;](#storecontentmodel) | ストアコンテンツモデルのリスト |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreContentModel](#storecontentmodel) | ストアコンテンツモデル |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;StoreSubscriptionContentModel&gt;](#storesubscriptioncontentmodel) | ストア定期課金コンテンツモデルモデルのリスト |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreSubscriptionContentModel](#storesubscriptioncontentmodel) | ストア定期課金コンテンツモデルモデル |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [CurrentModelMaster](#currentmodelmaster) | 有効化可能なマスターデータ |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [CurrentModelMaster](#currentmodelmaster) | 現在アクティブなモデルのマスターデータ |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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フェーズ版）<br>

1MBを超えるマスターデータをアップロードする場合は、3フェーズで更新を行います。<br>
1. このAPIを実行し、アップロード用のトークンとURLを取得します。<br>
2. 取得したURLに対して、マスターデータをアップロードします。<br>
3. UpdateCurrentMissionMaster にアップロードで取得したトークンを渡して実行し、マスターデータを反映します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| uploadToken | string | アップロード後に結果を反映する際に使用するトークン |
| uploadUrl | string | アップロード処理の実行に使用するURL |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [CurrentModelMaster](#currentmodelmaster) | 更新された現在アクティブなモデルのマスターデータ |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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から更新<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [CurrentModelMaster](#currentmodelmaster) | 更新された現在アクティブなモデルのマスターデータ |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;StoreContentModelMaster&gt;](#storecontentmodelmaster) | ストアコンテンツモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

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

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| name | string |  | ✓|  |  ~ 128文字 | ストアコンテンツモデル名 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ |
| appleAppStore | [AppleAppStoreContent](#appleappstorecontent) |  | |  |  | Apple App Store のコンテンツ<br>このストアコンテンツの Apple App Store 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |
| googlePlay | [GooglePlayContent](#googleplaycontent) |  | |  |  | Google Play のコンテンツ<br>このストアコンテンツの Google Play 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreContentModelMaster](#storecontentmodelmaster) | 作成したストアコンテンツマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストアコンテンツマスターを取得<br>

指定されたストアコンテンツモデルマスターを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreContentModelMaster](#storecontentmodelmaster) | ストアコンテンツマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストアコンテンツマスターを更新<br>

指定されたストアコンテンツモデルマスターを更新します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| contentName | string |  | ✓|  |  ~ 128文字 | ストアコンテンツモデル名 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ |
| appleAppStore | [AppleAppStoreContent](#appleappstorecontent) |  | |  |  | Apple App Store のコンテンツ<br>このストアコンテンツの Apple App Store 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |
| googlePlay | [GooglePlayContent](#googleplaycontent) |  | |  |  | Google Play のコンテンツ<br>このストアコンテンツの Google Play 商品情報（プロダクトID）です。レシート検証時に購入された商品との照合に使用されます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreContentModelMaster](#storecontentmodelmaster) | 更新したストアコンテンツマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストアコンテンツマスターを削除<br>

指定されたストアコンテンツモデルマスターを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreContentModelMaster](#storecontentmodelmaster) | 削除したストアコンテンツマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストア定期課金コンテンツモデルマスターの一覧を取得<br>

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



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| namePrefix | string |  | |  |  ~ 64文字 | ストア定期課金コンテンツモデル名のフィルター接頭辞 |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;StoreSubscriptionContentModelMaster&gt;](#storesubscriptioncontentmodelmaster) | ストア定期課金コンテンツモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストア定期課金コンテンツモデルマスターを新規作成<br>

スケジューリングパラメータと Apple App Store および Google Play のプラットフォーム固有設定を持つ新しいストア定期課金コンテンツモデルマスターを作成します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| name | string |  | ✓|  |  ~ 128文字 | ストア定期課金コンテンツモデル名 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ |
| scheduleNamespaceId | string |  | ✓|  |  ~ 1024文字 | サブスクリプション期間を連動させる GS2-Schedule のネームスペースGRN |
| triggerName | string |  | ✓|  |  ~ 128文字 | サブスクリプション期間を反映するトリガー名<br>サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。 |
| triggerExtendMode | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"just",<br>&nbsp;&nbsp;"rollupHour"<br>}<br> |  | | "just" |  | サブスクリプション期間をトリガーに反映する時のモード<br>サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。"just" はサブスクリプション期間をそのまま使用します。"rollupHour" は指定した時刻（UTC）まで延長し、日中の期限切れを回避します。"just": そのままサブスクリプション期間を反映 / "rollupHour": 次の日跨ぎ時刻まで延長してサブスクリプション期間を反映 /  |
| rollupHour | int | {triggerExtendMode} == "rollupHour" | | 0 | 0 ~ 23 | 日跨ぎの時刻 (UTC)<br>triggerExtendMode が "rollupHour" の場合、サブスクリプション期間は有効期限日のこの時刻（0〜23、UTC）まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。<br>※ triggerExtendMode が "rollupHour" であれば必須 |
| reallocateSpanDays | int |  | | 30 | 0 ~ 365 | サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間（日）<br>最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。 |
| appleAppStore | [AppleAppStoreSubscriptionContent](#appleappstoresubscriptioncontent) |  | |  |  | Apple App Store のコンテンツ<br>このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報（サブスクリプショングループID）です。 |
| googlePlay | [GooglePlaySubscriptionContent](#googleplaysubscriptioncontent) |  | |  |  | Google Play のコンテンツ<br>このサブスクリプションコンテンツの Google Play のサブスクリプション情報（プロダクトID）です。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreSubscriptionContentModelMaster](#storesubscriptioncontentmodelmaster) | 作成したストア定期課金コンテンツモデルマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストア定期課金コンテンツモデルマスターを取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreSubscriptionContentModelMaster](#storesubscriptioncontentmodelmaster) | ストア定期課金コンテンツモデルマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストア定期課金コンテンツモデルマスターを更新<br>

指定されたストア定期課金コンテンツモデルマスターを更新します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| contentName | string |  | ✓|  |  ~ 128文字 | ストア定期課金コンテンツモデル名 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ |
| scheduleNamespaceId | string |  | ✓|  |  ~ 1024文字 | サブスクリプション期間を連動させる GS2-Schedule のネームスペースGRN |
| triggerName | string |  | ✓|  |  ~ 128文字 | サブスクリプション期間を反映するトリガー名<br>サブスクリプションの有効期間を反映するために起動される GS2-Schedule のトリガー名です。トリガーの持続時間はサブスクリプションの有効期限に設定されます。 |
| triggerExtendMode | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"just",<br>&nbsp;&nbsp;"rollupHour"<br>}<br> |  | | "just" |  | サブスクリプション期間をトリガーに反映する時のモード<br>サブスクリプションの有効期限をトリガーの持続時間にどのようにマッピングするかを制御します。"just" はサブスクリプション期間をそのまま使用します。"rollupHour" は指定した時刻（UTC）まで延長し、日中の期限切れを回避します。"just": そのままサブスクリプション期間を反映 / "rollupHour": 次の日跨ぎ時刻まで延長してサブスクリプション期間を反映 /  |
| rollupHour | int | {triggerExtendMode} == "rollupHour" | | 0 | 0 ~ 23 | 日跨ぎの時刻 (UTC)<br>triggerExtendMode が "rollupHour" の場合、サブスクリプション期間は有効期限日のこの時刻（0〜23、UTC）まで延長されます。ユーザーのプレイセッション中にサブスクリプションが期限切れになるのを防ぎます。<br>※ triggerExtendMode が "rollupHour" であれば必須 |
| reallocateSpanDays | int |  | | 30 | 0 ~ 365 | サブスクリプションの契約情報を他のユーザーに割り当て可能となる期間（日）<br>最後の割り当てから、サブスクリプション契約を別のユーザーに再割り当てできるようになるまでの日数です。ユーザーがアカウントを変更する際の不正利用を防止するため、サブスクリプションの移行に待機期間を設けます。 |
| appleAppStore | [AppleAppStoreSubscriptionContent](#appleappstoresubscriptioncontent) |  | |  |  | Apple App Store のコンテンツ<br>このサブスクリプションコンテンツの Apple App Store のサブスクリプション情報（サブスクリプショングループID）です。 |
| googlePlay | [GooglePlaySubscriptionContent](#googleplaysubscriptioncontent) |  | |  |  | Google Play のコンテンツ<br>このサブスクリプションコンテンツの Google Play のサブスクリプション情報（プロダクトID）です。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreSubscriptionContentModelMaster](#storesubscriptioncontentmodelmaster) | 更新したストア定期課金コンテンツモデルマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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

ストア定期課金コンテンツモデルマスターを削除<br>

指定されたストア定期課金コンテンツモデルマスターを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [StoreSubscriptionContentModelMaster](#storesubscriptioncontentmodelmaster) | 削除したストア定期課金コンテンツモデルマスター |

#### 実装例




**Go**
```go

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

```

**PHP**
```php

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")
}

```

**Java**
```java

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);
}

```

**C#**
```csharp

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;

```

**TypeScript**
```typescript

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);
}

```

**Python**
```python

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)


```

**GS2-Script**
```lua

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;

```

**GS2-Script(Async)**
```lua

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;

```




---



