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

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

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



## モデル

### Namespace

ネームスペース<br>

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

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


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024文字 | ネームスペースGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  |  |  |  | トランザクション設定 |
| changePasswordIfTakeOver | bool |  |  | false |  | アカウント引き継ぎ時にパスワードを変更するか<br>アカウント引き継ぎ時にパスワードを変更するかどうかを指定します。<br>この設定により、アカウント引き継ぎを実行した後に引き継ぎ前のデバイスからのログインを制限することができます。 |
| differentUserIdForLoginAndDataRetention | bool |  |  | false |  | ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする<br>ログイン用ユーザーIDとデータ保持用ユーザーIDを分けるかどうかを指定します。<br>この設定により、プラットフォーマーが規定する個人情報保護の要件を少ない工数で満たせる可能性があります。<br><br>※このパラメータは、ネームスペースの作成時にのみ設定が可能です。 |
| createAccountScript | [ScriptSetting](#scriptsetting) |  |  |  |  | アカウント新規作成したときに実行するスクリプトの設定<br>アカウント作成のカスタムロジックを実装するのに使用されます。<br>Script トリガーリファレンス - [`createAccount`](../script/#createaccount) |
| authenticationScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 認証したときに実行するスクリプトの設定<br>認証プロセスのカスタマイズに役立ちます。<br>Script トリガーリファレンス - [`authentication`](../script/#authentication) |
| createTakeOverScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 引き継ぎ情報登録したときに実行するスクリプトの設定<br>引き継ぎ情報を初めて登録した時に報酬を与えるために、GS2-Mission のカウンターを上昇するなどのカスタムロジックを追加するのに使用されます。<br>Script トリガーリファレンス - [`createTakeOver`](../script/#createtakeover) |
| doTakeOverScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 引き継ぎ実行したときに実行するスクリプトの設定<br>引き継ぎ処理の追加ロジックを実装するのに役立ちます。<br>Script トリガーリファレンス - [`doTakeOver`](../script/#dotakeover) |
| banScript | [ScriptSetting](#scriptsetting) |  |  |  |  | アカウントBANステータスを追加したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`ban`](../script/#ban) |
| unBanScript | [ScriptSetting](#scriptsetting) |  |  |  |  | アカウントBANステータスを解除したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`unBan`](../script/#unban) |
| logSetting | [LogSetting](#logsetting) |  |  |  |  | ログの出力設定<br>ログデータの出力設定を管理します。この型は、ログデータを書き出すために使用される 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>"none",<br>"gs2_script",<br>"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 - ネームスペース



---

### 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>"commit_hash",<br>"branch",<br>"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から更新



---

### Account

ゲームプレイヤーアカウント<br>

ゲームプレイヤーを識別するID情報のエンティティです。<br>
ゲームプレイヤーアカウントは匿名アカウントであり、ユーザーID(UUID)とパスワード(ランダムな32文字の文字列)で構成されるため、ゲームプレイヤーはメールアドレスなどの情報を入力する必要はありません。<br>

発行されたゲームプレイヤーアカウントは、デバイスのローカルストレージに保存しておき、次回以降ログインに使用します。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| accountId | string |  | ※ |  |  ~ 1024文字 | ゲームプレイヤーアカウントGRN<br>※ サーバーが自動で設定 |
| userId | string |  | ✓ | UUID |  ~ 128文字 | ユーザーID |
| password | string |  | ✓ |  |  ~ 128文字 | パスワード<br>アカウントのセキュリティを確保するためのパスワードを格納します。<br>パスワードは最大128文字の長さを持ち、アカウントの保護に重要な役割を果たします。 |
| timeOffset | int |  |  | 0 | 0 ~ 315360000 | 現在時刻に対する補正値（現在時刻を起点とした秒数）<br>時刻補正値は、サーバーの現在時刻との差分を秒単位で表します。<br>この値はゲーム内のイベントや機能が特定の時間に合わせて動作する際に使用されます。 |
| banStatuses | [List&lt;BanStatus&gt;](#banstatus) |  |  | [] | 0 ~ 10 items | アカウントBANステータスリスト<br>アカウントに関連付けられたBAN（アクセス禁止）状態の詳細を格納します。<br>各エントリにはBANの理由、期間、およびその他の関連情報が含まれます。 |
| banned | bool |  |  | false |  | アカウントBANされているか<br>アカウントが現在BANされているかどうかを示します。<br>trueの場合、アカウントはアクセス禁止状態にあり、falseの場合はアクセス可能です。 |
| lastAuthenticatedAt | long |  |  |  |  | 最終認証時刻<br>アカウントが最後に認証された時刻です。<br>この値はアカウントが認証されるたびに更新されます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeAccounts - ゲームプレイヤーアカウントの一覧を取得
createAccount - ゲームプレイヤーアカウントを新規作成
updateTimeOffset - ゲームプレイヤーアカウントの現在時刻に対する補正値を更新
updateBanned - ゲームプレイヤーアカウントのアカウントBANステータスを更新
addBan - ゲームプレイヤーアカウントにアカウントBANステータスを追加
removeBan - ゲームプレイヤーアカウントのアカウントBANステータスを削除
getAccount - ゲームプレイヤーアカウントを取得
deleteAccount - ゲームプレイヤーアカウントを削除
authentication - ゲームプレイヤーアカウントを認証
doTakeOver - 引き継ぎを実行
doTakeOverOpenIdConnect - OpenID Connect を使用して引き継ぎを実行



---

### TakeOver

引き継ぎ情報<br>

引き継ぎ情報とは、デバイスの機種変更やプラットフォーム間のアカウントの移動・共有時に使用する情報です。<br>
個人を識別するユニークな文字列とパスワードで構成され、その適切な組み合わせを入力することで、Account(匿名アカウント)を取得することができます。<br>

1つの Account に対して複数の引き継ぎ情報を設定できます。<br>
複数の引き継ぎ情報を設定するにはそれぞれ異なるスロットを指定する必要があります。<br>
スロットには0～1024を指定できますので、最大1025種類の引き継ぎ情報を設定可能です。<br>

具体的な用例としては 0 には Sign in with Apple のアカウント情報を、1 には Google のアカウント情報を保存するようにする、というような使い方が想定されています。<br>
あくまでこの引き継ぎ情報はデータホルダーであり、ソーシャルアカウントとの認証の仕組みは別途用意する必要があります。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| takeOverId | string |  | ※ |  |  ~ 1024文字 | 引き継ぎ情報GRN<br>※ サーバーが自動で設定 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| type | int |  | ✓ |  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| userIdentifier | string |  | ✓ |  |  ~ 1024文字 | 引き継ぎ用ユーザーID<br>アカウントを引き継ぐ際に使用される個人を識別するためのユニークなキーです。<br>異なるアカウントで同一の userIdentifier を指定した場合、後で設定した値が優先されます。 |
| password | string |  | ✓ |  |  ~ 128文字 | パスワード<br>セキュリティを考慮して、このパスワードは機密情報として扱われ、ハッシュ値のみ保存されAPIの応答には値が含まれません。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeTakeOvers - 引き継ぎ情報の一覧を取得
describeTakeOversByUserId - ユーザーIDを指定して引き継ぎ情報の一覧を取得
createTakeOver - 引き継ぎ情報を新規作成
createTakeOverByUserId - ユーザーIDを指定して引き継ぎ情報を新規作成
createTakeOverOpenIdConnect - OpenID Connect を使用して引き継ぎ情報を新規作成
createTakeOverOpenIdConnectAndByUserId - ユーザーIDを指定して OpenID Connect を使用して引き継ぎ情報を新規作成
getTakeOver - 引き継ぎ情報を取得
getTakeOverByUserId - ユーザーIDを指定して引き継ぎ情報を取得
updateTakeOver - 引き継ぎ情報を更新
updateTakeOverByUserId - ユーザーIDを指定して引き継ぎ情報を更新
deleteTakeOver - 引き継ぎ情報を削除
deleteTakeOverByUserIdentifier - 引き継ぎ用ユーザーIDを指定して引き継ぎ情報を削除
deleteTakeOverByUserId - ユーザーIDを指定して引き継ぎ情報を削除



---

### PlatformId

外部プラットフォームのアカウントID<br>

X、Instagram、Facebook などの外部サービスのユーザー識別子を保持します。<br>
他のプレイヤーは外部プラットフォームのアカウント情報を使用して、GS2-Account ユーザーIDを検索することができます。<br>

Instagram のフォロワーや、Facebook のフレンドをゲーム内のフレンドとしてインポートする際に、GS2-Account のアカウントを特定するために使用します。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| platformId | string |  | ※ |  |  ~ 1024文字 | 外部プラットフォームのアカウントID GRN<br>※ サーバーが自動で設定 |
| userId | string |  | ✓ |  |  ~ 128文字 | GS2-Account ユーザーID<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓ |  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | ✓ |  |  ~ 1024文字 | 外部プラットフォームのユーザーID<br>外部プラットフォームにおけるユーザーの一意な識別子（例：ソーシャルメディアのユーザーIDやメールアドレス）です。`type`(スロット番号)と組み合わせて、特定のプラットフォームアカウントを識別するために使用されます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describePlatformIds - 外部プラットフォームのアカウントIDの一覧を取得
describePlatformIdsByUserId - GS2-Account ユーザーID を指定して 外部プラットフォームのアカウントID の一覧を取得
createPlatformId - 外部プラットフォームのアカウントIDを新規作成
createPlatformIdByUserId - GS2-Account ユーザーIDを指定して外部プラットフォームのアカウントIDを新規作成
getPlatformId - 外部プラットフォームのアカウントIDを取得
getPlatformIdByUserId - ユーザーIDを指定して外部プラットフォームのアカウントIDを取得
deletePlatformId - 外部プラットフォームのアカウントIDを削除
deletePlatformIdByUserIdentifier - 外部プラットフォームのユーザーIDを指定して外部プラットフォームのアカウントIDを削除
deletePlatformIdByUserId - GS2-Account ユーザーIDを指定して外部プラットフォームのアカウントIDを削除



---

### DataOwner

データオーナー<br>

データオーナーはネームスペースの設定で「ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする」を指定した際に使用されます。<br>
ユーザーIDとは異なるデータオーナーIDを発行し、GS2-Account の認証処理を通してアクセストークンを受け取った場合に取得できるユーザーIDはデータオーナーIDになります。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| dataOwnerId | string |  | ※ |  |  ~ 1024文字 | データオーナーGRN<br>※ サーバーが自動で設定 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| name | string |  | ✓ | UUID |  ~ 36文字 | データオーナーID<br>データオーナーの一意な識別子として機能します。<br>データオーナーIDは、データの実際の所有者を表し、ユーザーIDとは異なる可能性があります。<br>このIDはシステムによって自動的に生成され、各データオーナーに対して一意です。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
getDataOwnerByUserId - データオーナーを取得
updateDataOwnerByUserId - データオーナーIDを任意の値で更新
deleteDataOwnerByUserId - データオーナーを削除



---

### TakeOverTypeModel

引き継ぎ情報タイプモデル<br>

引き継ぎ情報を定義するモデルです。<br>

引き継ぎ情報とは、デバイスの機種変更やプラットフォーム間のアカウントの移動・共有時に使用する情報です。<br>
個人を識別するユニークな文字列とパスワードで構成され、その適切な組み合わせを入力することで、Account(匿名アカウント)を取得することができます。<br>

1つの Account に対して複数の引き継ぎ情報を設定できます。<br>
複数の引き継ぎ情報を設定するにはそれぞれ異なるスロットを指定する必要があります。<br>
スロットには0～1024を指定できますので、最大1025種類の引き継ぎ情報を設定可能です。<br>

具体的な用例としては 0 には Sign in with Apple のアカウント情報を、1 には Google のアカウント情報を保存するようにする、というような使い方が想定されています。<br>
あくまでこの引き継ぎ情報はデータホルダーであり、ソーシャルアカウントとの認証の仕組みは別途用意する必要があります。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| takeOverTypeModelId | string |  | ※ |  |  ~ 1024文字 | 引き継ぎ情報タイプモデルGRN<br>※ サーバーが自動で設定 |
| type | int |  | ✓ |  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| metadata | string |  |  |  |  ~ 2048文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| openIdConnectSetting | [OpenIdConnectSetting](#openidconnectsetting) |  | ✓ |  |  | OpenID Connect の設定<br>OpenID Connect 準拠の Identity Provider (IdP) と連携するための設定です。ディスカバリURL、クライアント認証情報、Apple Sign In パラメータなどのプラットフォーム固有の設定が含まれます。 |

**関連するメソッド:**
describeTakeOverTypeModels - 引き継ぎ情報タイプモデルの一覧を取得
getTakeOverTypeModel - 引き継ぎ情報タイプモデルを取得



---

### OpenIdConnectSetting

OpenID Connect の設定<br>

OpenID Connect 準拠の IdP の設定を登録することで、アカウントの引き継ぎ情報として IdP 連携を利用できるようになります。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| configurationPath | string |  | ✓ |  |  ~ 1024文字 | OpenID Connect 設定 URL<br>OpenID Connect プロバイダーのディスカバリエンドポイント URL です。well-known 形式（例：https\://example.com/.well-known/openid-configuration）に従う必要があります。 |
| clientId | string |  | ✓ |  |  ~ 1024文字 | クライアントID<br>IdP に登録されたアプリケーションのクライアントIDです。 |
| clientSecret | string | {configurationPath} != "https\://appleid.apple.com/.well-known/openid-configuration" | ✓※ |  |  ~ 1024文字 | クライアントシークレット<br>※ configurationPath が "https\://appleid.apple.com/.well-known/openid-configuration" 以外の、その他の IdP 連携であれば 必須 |
| appleTeamId | string | {configurationPath} == "https\://appleid.apple.com/.well-known/openid-configuration" | ✓※ |  |  ~ 1024文字 | Apple Developer チームID<br>Apple Developer アカウントのチームIDです。Sign in with Apple 認証に必要です。<br>※ configurationPath が "https\://appleid.apple.com/.well-known/openid-configuration" であれば 必須 |
| appleKeyId | string | {configurationPath} == "https\://appleid.apple.com/.well-known/openid-configuration" | ✓※ |  |  ~ 1024文字 | Apple に登録済みのキーID<br>Sign in with Apple 用に Apple Developer アカウントに登録されたキーIDです。<br>※ configurationPath が "https\://appleid.apple.com/.well-known/openid-configuration" であれば 必須 |
| applePrivateKeyPem | string | {configurationPath} == "https\://appleid.apple.com/.well-known/openid-configuration" | ✓※ |  |  ~ 10240文字 | Apple から受け取った秘密鍵<br>Apple Developer ポータルからダウンロードした PEM 形式の秘密鍵です。Sign in with Apple 認証に必要です。<br>※ configurationPath が "https\://appleid.apple.com/.well-known/openid-configuration" であれば 必須 |
| doneEndpointUrl | string |  |  |  |  ~ 1024文字 | 認証完了時に遷移するURL<br>未指定の場合 /authorization/done に遷移します。<br>Query String に id_token が付与されます。 |
| additionalScopeValues | [List&lt;ScopeValue&gt;](#scopevalue) |  |  | [] | 0 ~ 10 items | OpenID Connect で取得する追加のスコープ<br>デフォルトの OpenID Connect スコープに加えて IdP にリクエストする追加の OAuth スコープです。認証時に追加のユーザー情報を取得することができます。 |
| additionalReturnValues | List&lt;string&gt; |  |  | [] | 0 ~ 10 items | OpenID Connect で取得する追加の返却値<br>ID トークンまたは UserInfo レスポンスから返却値に含める追加のクレーム名です。指定されたクレームが抽出され、標準の認証結果とともに返却されます。 |

**関連するメソッド:**
createTakeOverTypeModelMaster - 引き継ぎ情報タイプモデルマスターを新規作成
updateTakeOverTypeModelMaster - 引き継ぎ情報タイプモデルマスターデータを更新


**関連するモデル:**
TakeOverTypeModel - 引き継ぎ情報タイプモデル
TakeOverTypeModelMaster - 引き継ぎ情報タイプモデルマスター



---

### ScopeValue

スコープ値<br>

OpenID Connect 認証時に取得される追加の OAuth スコープ値を表すキーと値のペアです。標準の OpenID Connect クレーム以外に IdP から取得した追加データの保存に使用されます。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| key | string |  | ✓ |  |  ~ 64文字 | 名前<br>認証時に IdP に対してリクエストしたスコープ名です。 |
| value | string |  |  |  |  ~ 51200文字 | 値<br>対応するスコープに対して IdP から返却された値です。 |

**関連するモデル:**
OpenIdConnectSetting - OpenID Connect の設定



---

### PlatformUser

外部プラットフォームのユーザー情報<br>

外部プラットフォームにおけるユーザー情報を保持します。プラットフォーム固有のユーザー識別子と対応する GS2-Account ユーザーIDのマッピングを含み、外部プラットフォームのアカウントIDによるプレイヤー検索に使用されます。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| type | int |  | ✓ |  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | ✓ |  |  ~ 1024文字 | 外部プラットフォームのユーザーID<br>外部プラットフォームにおけるユーザーの一意な識別子（例：ソーシャルメディアのユーザーIDやメールアドレス）です。`type`(スロット番号)と組み合わせて、特定のプラットフォームアカウントを識別するために使用されます。 |
| userId | string |  | ✓ |  |  ~ 128文字 | GS2-Account ユーザーID<br>このプラットフォームユーザーにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |

**関連するメソッド:**
findPlatformId - 外部プラットフォームのアカウントIDを指定してGS2-AccountのユーザーIDを取得
findPlatformIdByUserId - GS2-Account ユーザーIDを指定して外部プラットフォームのアカウントIDを取得



---

### BanStatus

アカウントBANステータス<br>

ゲームプレイヤーアカウントに適用されたBAN（アクセス禁止）状態に関する情報を表します。<br>
この型は、BANが適用された理由、BANの名称、およびBANの解除予定日時などの詳細情報を含みます。<br>
BAN状態は、不正行為や規約違反など、様々な理由でアカウントに適用されることがあり、この型はその状態を管理するのに役立ちます。<br>
システムは、この情報を基にアカウントのアクセス権限を制御し、必要に応じてアクセスの制限や解除を行います。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ | UUID |  ~ 36文字 | BANステータス名<br>BAN状態の一意な名前を保持します。名前には任意の値を設定できます。<br>省略した場合は UUID（Universally Unique Identifier）フォーマットで自動的に生成され、各BANステータスを識別するために使用されます。<br>このIDにより、複数のBANステータスを簡単に追跡できます。 |
| reason | string |  | ✓ |  |  ~ 256文字 | アカウントBANされた理由<br>アカウントがBANされた具体的な理由を説明します。<br>最大256文字の長さで、アカウントBANの原因を明確にするのに役立ちます。<br>この情報は、アカウントの管理者や運営チームが参照するだけでなく、ゲームクライアントへの応答値にも含まれます。 |
| releaseTimestamp | long |  | ✓ |  |  | BANが解除される日時<br>アカウントBANが解除される予定の日時を示します。<br>この日時が過ぎると、アカウントは自動的にBAN解除状態になり、通常のアクセスが可能になります。 |

**関連するメソッド:**
addBan - ゲームプレイヤーアカウントにアカウントBANステータスを追加
authentication - ゲームプレイヤーアカウントを認証


**関連するモデル:**
Account - ゲームプレイヤーアカウント



---

### CurrentModelMaster

現在アクティブな引き継ぎ情報タイプモデルのマスターデータ<br>

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

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


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

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



---

### TakeOverTypeModelMaster

引き継ぎ情報タイプモデルマスター<br>

引き継ぎ情報タイプモデルマスターは、ゲーム内で使用される引き継ぎ情報タイプモデルの編集・管理用データで、マネージメントコンソールのマスターデータエディタで一時的に保持されます。<br>
インポート・更新処理を行うことで、実際にゲームから参照される引き継ぎ情報タイプモデルとして反映されます。<br>

引き継ぎ情報とは、デバイスの機種変更やプラットフォーム間のアカウントの移動・共有時に使用する情報です。<br>
個人を識別するユニークな文字列とパスワードで構成され、その適切な組み合わせを入力することで、Account(匿名アカウント)を取得することができます。<br>

1つの Account に対して複数の引き継ぎ情報を設定できます。<br>
複数の引き継ぎ情報を設定するにはそれぞれ異なるスロットを指定する必要があります。<br>
スロットには0～1024を指定できますので、最大1025種類の引き継ぎ情報を設定可能です。<br>

具体的な用例としては 0 には Sign in with Apple のアカウント情報を、1 には Google のアカウント情報を保存するようにする、というような使い方が想定されています。<br>
あくまでこの引き継ぎ情報はデータホルダーであり、ソーシャルアカウントとの認証の仕組みは別途用意する必要があります。


|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| takeOverTypeModelId | string |  | ※ |  |  ~ 1024文字 | 引き継ぎ情報タイプモデルマスターデータGRN<br>※ サーバーが自動で設定 |
| type | int |  | ✓ |  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| metadata | string |  |  |  |  ~ 2048文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| openIdConnectSetting | [OpenIdConnectSetting](#openidconnectsetting) |  | ✓ |  |  | OpenID Connect の設定<br>OpenID Connect 準拠の Identity Provider (IdP) と連携するための設定です。ディスカバリURL、クライアント認証情報、Apple Sign In パラメータなどのプラットフォーム固有の設定が含まれます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeTakeOverTypeModelMasters - 引き継ぎ情報タイプモデルマスターの一覧を取得
createTakeOverTypeModelMaster - 引き継ぎ情報タイプモデルマスターを新規作成
getTakeOverTypeModelMaster - 引き継ぎ情報タイプモデルマスターを取得
updateTakeOverTypeModelMaster - 引き継ぎ情報タイプモデルマスターデータを更新
deleteTakeOverTypeModelMaster - 引き継ぎ情報タイプモデルマスターデータを削除



---
## メソッド

### 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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeNamespacesRequest;
import io.gs2.account.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

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

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

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

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('account')

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>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | トランザクション設定 |
| changePasswordIfTakeOver | bool |  | | false |  | アカウント引き継ぎ時にパスワードを変更するか<br>アカウント引き継ぎ時にパスワードを変更するかどうかを指定します。<br>この設定により、アカウント引き継ぎを実行した後に引き継ぎ前のデバイスからのログインを制限することができます。 |
| differentUserIdForLoginAndDataRetention | bool |  | | false |  | ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする<br>ログイン用ユーザーIDとデータ保持用ユーザーIDを分けるかどうかを指定します。<br>この設定により、プラットフォーマーが規定する個人情報保護の要件を少ない工数で満たせる可能性があります。<br><br>※このパラメータは、ネームスペースの作成時にのみ設定が可能です。 |
| createAccountScript | [ScriptSetting](#scriptsetting) |  | |  |  | アカウント新規作成したときに実行するスクリプトの設定<br>アカウント作成のカスタムロジックを実装するのに使用されます。<br>Script トリガーリファレンス - [`createAccount`](../script/#createaccount) |
| authenticationScript | [ScriptSetting](#scriptsetting) |  | |  |  | 認証したときに実行するスクリプトの設定<br>認証プロセスのカスタマイズに役立ちます。<br>Script トリガーリファレンス - [`authentication`](../script/#authentication) |
| createTakeOverScript | [ScriptSetting](#scriptsetting) |  | |  |  | 引き継ぎ情報登録したときに実行するスクリプトの設定<br>引き継ぎ情報を初めて登録した時に報酬を与えるために、GS2-Mission のカウンターを上昇するなどのカスタムロジックを追加するのに使用されます。<br>Script トリガーリファレンス - [`createTakeOver`](../script/#createtakeover) |
| doTakeOverScript | [ScriptSetting](#scriptsetting) |  | |  |  | 引き継ぎ実行したときに実行するスクリプトの設定<br>引き継ぎ処理の追加ロジックを実装するのに役立ちます。<br>Script トリガーリファレンス - [`doTakeOver`](../script/#dotakeover) |
| banScript | [ScriptSetting](#scriptsetting) |  | |  |  | アカウントBANステータスを追加したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`ban`](../script/#ban) |
| unBanScript | [ScriptSetting](#scriptsetting) |  | |  |  | アカウントBANステータスを解除したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`unBan`](../script/#unban) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | ログの出力設定<br>ログデータの出力設定を管理します。この型は、ログデータを書き出すために使用される GS2-Log のネームスペース情報を保持します。 |

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &account.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        ChangePasswordIfTakeOver: pointy.Bool(false),
        DifferentUserIdForLoginAndDataRetention: nil,
        CreateAccountScript: nil,
        AuthenticationScript: nil,
        CreateTakeOverScript: nil,
        DoTakeOverScript: nil,
        BanScript: nil,
        UnBanScript: nil,
        LogSetting: &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withChangePasswordIfTakeOver(false)
            ->withDifferentUserIdForLoginAndDataRetention(null)
            ->withCreateAccountScript(null)
            ->withAuthenticationScript(null)
            ->withCreateTakeOverScript(null)
            ->withDoTakeOverScript(null)
            ->withBanScript(null)
            ->withUnBanScript(null)
            ->withLogSetting((new \Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateNamespaceRequest;
import io.gs2.account.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withChangePasswordIfTakeOver(false)
            .withDifferentUserIdForLoginAndDataRetention(null)
            .withCreateAccountScript(null)
            .withAuthenticationScript(null)
            .withCreateTakeOverScript(null)
            .withDoTakeOverScript(null)
            .withBanScript(null)
            .withUnBanScript(null)
            .withLogSetting(new io.gs2.account.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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Account.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithChangePasswordIfTakeOver(false)
        .WithDifferentUserIdForLoginAndDataRetention(null)
        .WithCreateAccountScript(null)
        .WithAuthenticationScript(null)
        .WithCreateTakeOverScript(null)
        .WithDoTakeOverScript(null)
        .WithBanScript(null)
        .WithUnBanScript(null)
        .WithLogSetting(new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createNamespace(
        new Gs2Account.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withChangePasswordIfTakeOver(false)
            .withDifferentUserIdForLoginAndDataRetention(null)
            .withCreateAccountScript(null)
            .withAuthenticationScript(null)
            .withCreateTakeOverScript(null)
            .withDoTakeOverScript(null)
            .withBanScript(null)
            .withUnBanScript(null)
            .withLogSetting(new Gs2Account.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 account

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

try:
    result = client.create_namespace(
        account.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_change_password_if_take_over(False)
            .with_different_user_id_for_login_and_data_retention(None)
            .with_create_account_script(None)
            .with_authentication_script(None)
            .with_create_take_over_script(None)
            .with_do_take_over_script(None)
            .with_ban_script(None)
            .with_un_ban_script(None)
            .with_log_setting(
                account.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('account')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    changePasswordIfTakeOver=false,
    differentUserIdForLoginAndDataRetention=nil,
    createAccountScript=nil,
    authenticationScript=nil,
    createTakeOverScript=nil,
    doTakeOverScript=nil,
    banScript=nil,
    unBanScript=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('account')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    changePasswordIfTakeOver=false,
    differentUserIdForLoginAndDataRetention=nil,
    createAccountScript=nil,
    authenticationScript=nil,
    createTakeOverScript=nil,
    doTakeOverScript=nil,
    banScript=nil,
    unBanScript=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 | ネームスペースの状態<br>"ACTIVE": 有効 / "DELETED": 削除済み /  |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetNamespaceStatusRequest;
import io.gs2.account.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

try {
    const result = await client.getNamespaceStatus(
        new Gs2Account.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_namespace_status(
        account.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetNamespaceRequest;
import io.gs2.account.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

try {
    const result = await client.getNamespace(
        new Gs2Account.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_namespace(
        account.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | トランザクション設定 |
| changePasswordIfTakeOver | bool |  | | false |  | アカウント引き継ぎ時にパスワードを変更するか<br>アカウント引き継ぎ時にパスワードを変更するかどうかを指定します。<br>この設定により、アカウント引き継ぎを実行した後に引き継ぎ前のデバイスからのログインを制限することができます。 |
| createAccountScript | [ScriptSetting](#scriptsetting) |  | |  |  | アカウント新規作成したときに実行するスクリプトの設定<br>アカウント作成のカスタムロジックを実装するのに使用されます。<br>Script トリガーリファレンス - [`createAccount`](../script/#createaccount) |
| authenticationScript | [ScriptSetting](#scriptsetting) |  | |  |  | 認証したときに実行するスクリプトの設定<br>認証プロセスのカスタマイズに役立ちます。<br>Script トリガーリファレンス - [`authentication`](../script/#authentication) |
| createTakeOverScript | [ScriptSetting](#scriptsetting) |  | |  |  | 引き継ぎ情報登録したときに実行するスクリプトの設定<br>引き継ぎ情報を初めて登録した時に報酬を与えるために、GS2-Mission のカウンターを上昇するなどのカスタムロジックを追加するのに使用されます。<br>Script トリガーリファレンス - [`createTakeOver`](../script/#createtakeover) |
| doTakeOverScript | [ScriptSetting](#scriptsetting) |  | |  |  | 引き継ぎ実行したときに実行するスクリプトの設定<br>引き継ぎ処理の追加ロジックを実装するのに役立ちます。<br>Script トリガーリファレンス - [`doTakeOver`](../script/#dotakeover) |
| banScript | [ScriptSetting](#scriptsetting) |  | |  |  | アカウントBANステータスを追加したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`ban`](../script/#ban) |
| unBanScript | [ScriptSetting](#scriptsetting) |  | |  |  | アカウントBANステータスを解除したときに実行するスクリプトの設定<br>Script トリガーリファレンス - [`unBan`](../script/#unban) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | ログの出力設定<br>ログデータの出力設定を管理します。この型は、ログデータを書き出すために使用される GS2-Log のネームスペース情報を保持します。 |

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &account.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        ChangePasswordIfTakeOver: pointy.Bool(true),
        CreateAccountScript: &account.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"),
        },
        AuthenticationScript: &account.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"),
        },
        CreateTakeOverScript: &account.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"),
        },
        DoTakeOverScript: &account.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"),
        },
        BanScript: nil,
        UnBanScript: nil,
        LogSetting: &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withChangePasswordIfTakeOver(true)
            ->withCreateAccountScript((new \Gs2\Account\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
            ->withAuthenticationScript((new \Gs2\Account\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"))
            ->withCreateTakeOverScript((new \Gs2\Account\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"))
            ->withDoTakeOverScript((new \Gs2\Account\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
            ->withBanScript(null)
            ->withUnBanScript(null)
            ->withLogSetting((new \Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateNamespaceRequest;
import io.gs2.account.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withChangePasswordIfTakeOver(true)
            .withCreateAccountScript(new io.gs2.account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
            .withAuthenticationScript(new io.gs2.account.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"))
            .withCreateTakeOverScript(new io.gs2.account.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"))
            .withDoTakeOverScript(new io.gs2.account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
            .withBanScript(null)
            .withUnBanScript(null)
            .withLogSetting(new io.gs2.account.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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Account.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithChangePasswordIfTakeOver(true)
        .WithCreateAccountScript(new Gs2.Gs2Account.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
        .WithAuthenticationScript(new Gs2.Gs2Account.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"))
        .WithCreateTakeOverScript(new Gs2.Gs2Account.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"))
        .WithDoTakeOverScript(new Gs2.Gs2Account.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
        .WithBanScript(null)
        .WithUnBanScript(null)
        .WithLogSetting(new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateNamespace(
        new Gs2Account.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withChangePasswordIfTakeOver(true)
            .withCreateAccountScript(new Gs2Account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
            .withAuthenticationScript(new Gs2Account.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"))
            .withCreateTakeOverScript(new Gs2Account.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"))
            .withDoTakeOverScript(new Gs2Account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
            .withBanScript(null)
            .withUnBanScript(null)
            .withLogSetting(new Gs2Account.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 account

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

try:
    result = client.update_namespace(
        account.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_change_password_if_take_over(True)
            .with_create_account_script(
                account.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002'))
            .with_authentication_script(
                account.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_create_take_over_script(
                account.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_do_take_over_script(
                account.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008'))
            .with_ban_script(None)
            .with_un_ban_script(None)
            .with_log_setting(
                account.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('account')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    changePasswordIfTakeOver=true,
    createAccountScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002",
    },
    authenticationScript={
        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",
    },
    createTakeOverScript={
        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",
    },
    doTakeOverScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008",
    },
    banScript=nil,
    unBanScript=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('account')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    changePasswordIfTakeOver=true,
    createAccountScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002",
    },
    authenticationScript={
        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",
    },
    createTakeOverScript={
        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",
    },
    doTakeOverScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008",
    },
    banScript=nil,
    unBanScript=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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteNamespaceRequest;
import io.gs2.account.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

try {
    const result = await client.deleteNamespace(
        new Gs2Account.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_namespace(
        account.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetServiceVersionRequest;
import io.gs2.account.result.GetServiceVersionResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getServiceVersion(
        new Gs2Account.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_service_version(
        account.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DumpUserDataByUserIdRequest;
import io.gs2.account.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Account.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

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


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.account.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import account

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

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

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CleanUserDataByUserIdRequest;
import io.gs2.account.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Account.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

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


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.account.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Account.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

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


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.account.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

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

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

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

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.ImportUserDataByUserIdRequest;
import io.gs2.account.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import account

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

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

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('account')

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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckImportUserDataByUserIdRequest;
import io.gs2.account.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

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

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

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

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

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

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('account')

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;

```



---

### describeAccounts

ゲームプレイヤーアカウントの一覧を取得<br>

指定されたネームスペースに存在するすべてのゲームプレイヤーアカウントの一覧を取得します。<br>
取得されるアカウントの情報には、アカウントID、ステータス、作成日時などが含まれます。<br>
ページネーションをサポートしており、一度に取得できるアカウントの数を制限し、次のページのトークンを提供します。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;Account&gt;](#account) | ゲームプレイヤーアカウントのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeAccounts(
    &account.DescribeAccountsRequest {
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeAccountsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeAccounts(
        (new DescribeAccountsRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeAccountsRequest;
import io.gs2.account.result.DescribeAccountsResult;

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

try {
    DescribeAccountsResult result = client.describeAccounts(
        new DescribeAccountsRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Account> 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeAccountsResult> asyncResult = null;
yield return client.DescribeAccounts(
    new Gs2.Gs2Account.Request.DescribeAccountsRequest()
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.describeAccounts(
        new Gs2Account.DescribeAccountsRequest()
            .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 account

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

try:
    result = client.describe_accounts(
        account.DescribeAccountsRequest()
            .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('account')

api_result = client.describe_accounts({
    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('account')

api_result_handler = client.describe_accounts_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;

```



---

### createAccount

ゲームプレイヤーアカウントを新規作成<br>

このメソッドは新しいゲームプレイヤーアカウントを作成します。<br>
アカウントの作成にあたってユーザーID、パスワードの指定は不要です。ユーザーID、パスワードは自動的に生成されます。<br>
作成成功時、新しく作成されたアカウントの詳細情報がレスポンスとして返されます。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | 作成したゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateAccount(
    &account.CreateAccountRequest {
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateAccountRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createAccount(
        (new CreateAccountRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateAccountRequest;
import io.gs2.account.result.CreateAccountResult;

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

try {
    CreateAccountResult result = client.createAccount(
        new CreateAccountRequest()
            .withNamespaceName("namespace-0001")
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateAccountResult> asyncResult = null;
yield return client.CreateAccount(
    new Gs2.Gs2Account.Request.CreateAccountRequest()
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createAccount(
        new Gs2Account.CreateAccountRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_account(
        account.CreateAccountRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_account({
    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('account')

api_result_handler = client.create_account_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;

```



---

### updateTimeOffset

ゲームプレイヤーアカウントの現在時刻に対する補正値を更新<br>

特定のゲームプレイヤーアカウントの時刻補正値を更新します。<br>
この時刻補正は、未来のイベントスケジュールを事前にテストするために活用できます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| timeOffset | int |  | | 0 | 0 ~ 315360000 | 現在時刻に対する補正値（現在時刻を起点とした秒数）<br>時刻補正値は、サーバーの現在時刻との差分を秒単位で表します。<br>この値はゲーム内のイベントや機能が特定の時間に合わせて動作する際に使用されます。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | 更新したゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateTimeOffset(
    &account.UpdateTimeOffsetRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        TimeOffset: nil,
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTimeOffsetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateTimeOffset(
        (new UpdateTimeOffsetRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withTimeOffset(null)
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTimeOffsetRequest;
import io.gs2.account.result.UpdateTimeOffsetResult;

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

try {
    UpdateTimeOffsetResult result = client.updateTimeOffset(
        new UpdateTimeOffsetRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffset(null)
            .withTimeOffsetToken(null)
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateTimeOffsetResult> asyncResult = null;
yield return client.UpdateTimeOffset(
    new Gs2.Gs2Account.Request.UpdateTimeOffsetRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithTimeOffset(null)
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateTimeOffset(
        new Gs2Account.UpdateTimeOffsetRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffset(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.update_time_offset(
        account.UpdateTimeOffsetRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_time_offset(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.update_time_offset({
    namespaceName="namespace-0001",
    userId="userId-0001",
    timeOffset=nil,
    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('account')

api_result_handler = client.update_time_offset_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    timeOffset=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
item = result.item;

```



---

### updateBanned

ゲームプレイヤーアカウントのアカウントBANステータスを更新<br>

特定のゲームプレイヤーアカウントのBAN（アクセス禁止）状態を更新するために使用されます。<br>
アカウントのBAN状態を有効または無効にすることができ、これによりアカウントのゲーム内利用を制限することができます。<br>
アカウントIDと新しいBAN状態を指定して更新します。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| banned | bool |  | | false |  | アカウントBANされているか<br>アカウントが現在BANされているかどうかを示します。<br>trueの場合、アカウントはアクセス禁止状態にあり、falseの場合はアクセス可能です。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | 更新したゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateBanned(
    &account.UpdateBannedRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Banned: pointy.Bool(true),
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateBannedRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateBanned(
        (new UpdateBannedRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withBanned(true)
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateBannedRequest;
import io.gs2.account.result.UpdateBannedResult;

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

try {
    UpdateBannedResult result = client.updateBanned(
        new UpdateBannedRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withBanned(true)
            .withTimeOffsetToken(null)
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateBannedResult> asyncResult = null;
yield return client.UpdateBanned(
    new Gs2.Gs2Account.Request.UpdateBannedRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithBanned(true)
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateBanned(
        new Gs2Account.UpdateBannedRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withBanned(true)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.update_banned(
        account.UpdateBannedRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_banned(True)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.update_banned({
    namespaceName="namespace-0001",
    userId="userId-0001",
    banned=true,
    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('account')

api_result_handler = client.update_banned_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    banned=true,
    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;

```



---

### addBan

ゲームプレイヤーアカウントにアカウントBANステータスを追加<br>

ゲームプレイヤーアカウントにアカウントBANステータスを追加するために使用されます。<br>
特定のアカウントに対して、一時的または永続的なアクセス禁止を設定できます。<br>
BANを追加するには、アカウントIDとBAN状態（理由や期間を含む）を指定する必要があります。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | 更新したゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.AddBan(
    &account.AddBanRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        BanStatus: &account.BanStatus{
            Name: pointy.String("feature1"),
            Reason: pointy.String("reason"),
            ReleaseTimestamp: pointy.Int64(1000000000000),
        },
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\AddBanRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addBan(
        (new AddBanRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withBanStatus((new BanStatus())
                ->withName("feature1")
                ->withReason("reason")
                ->withReleaseTimestamp(1000000000000)
            )
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.AddBanRequest;
import io.gs2.account.result.AddBanResult;

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

try {
    AddBanResult result = client.addBan(
        new AddBanRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withBanStatus(new BanStatus()
                .withName("feature1")
                .withReason("reason")
                .withReleaseTimestamp(1000000000000L)
            )
            .withTimeOffsetToken(null)
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.AddBanResult> asyncResult = null;
yield return client.AddBan(
    new Gs2.Gs2Account.Request.AddBanRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithBanStatus(new Gs2.Gs2Account.Model.BanStatus()
            .WithName("feature1")
            .WithReason("reason")
            .WithReleaseTimestamp(1000000000000L)
        )
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.addBan(
        new Gs2Account.AddBanRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withBanStatus(new Gs2Account.model.BanStatus()
                .withName("feature1")
                .withReason("reason")
                .withReleaseTimestamp(1000000000000)
            )
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.add_ban(
        account.AddBanRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_ban_status(account.BanStatus()
                .with_name('feature1')
                .with_reason('reason')
                .with_release_timestamp(1000000000000)
            )
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.add_ban({
    namespaceName="namespace-0001",
    userId="userId-0001",
    banStatus={
        name="feature1",
        reason="reason",
        release_timestamp=1000000000000,
    },
    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('account')

api_result_handler = client.add_ban_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    banStatus={
        name="feature1",
        reason="reason",
        release_timestamp=1000000000000,
    },
    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;

```



---

### removeBan

ゲームプレイヤーアカウントのアカウントBANステータスを削除<br>

特定のゲームプレイヤーアカウントに適用されたアカウントBANステータスを削除します。<br>
削除を行うには、ユーザーIDと削除するアカウントBANステータスの名前を指定します。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | 更新したゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.RemoveBan(
    &account.RemoveBanRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        BanStatusName: pointy.String("status-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\RemoveBanRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->removeBan(
        (new RemoveBanRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withBanStatusName("status-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.RemoveBanRequest;
import io.gs2.account.result.RemoveBanResult;

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

try {
    RemoveBanResult result = client.removeBan(
        new RemoveBanRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withBanStatusName("status-0001")
            .withTimeOffsetToken(null)
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.RemoveBanResult> asyncResult = null;
yield return client.RemoveBan(
    new Gs2.Gs2Account.Request.RemoveBanRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithBanStatusName("status-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.removeBan(
        new Gs2Account.RemoveBanRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withBanStatusName("status-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.remove_ban(
        account.RemoveBanRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_ban_status_name('status-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.remove_ban({
    namespaceName="namespace-0001",
    userId="userId-0001",
    banStatusName="status-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('account')

api_result_handler = client.remove_ban_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    banStatusName="status-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;

```



---

### getAccount

ゲームプレイヤーアカウントを取得<br>

指定されたIDを持つ特定のゲームプレイヤーアカウントの詳細情報を取得します。<br>
取得される情報には、アカウントの名前、ステータス、作成日時などが含まれます。<br>
このメソッドは、アカウントの詳細情報を表示するためのものです。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | ゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetAccount(
    &account.GetAccountRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        IncludeLastAuthenticatedAt: nil,
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetAccountRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getAccount(
        (new GetAccountRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withIncludeLastAuthenticatedAt(null)
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetAccountRequest;
import io.gs2.account.result.GetAccountResult;

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

try {
    GetAccountResult result = client.getAccount(
        new GetAccountRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withIncludeLastAuthenticatedAt(null)
            .withTimeOffsetToken(null)
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetAccountResult> asyncResult = null;
yield return client.GetAccount(
    new Gs2.Gs2Account.Request.GetAccountRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithIncludeLastAuthenticatedAt(null)
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getAccount(
        new Gs2Account.GetAccountRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withIncludeLastAuthenticatedAt(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_account(
        account.GetAccountRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_include_last_authenticated_at(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_account({
    namespaceName="namespace-0001",
    userId="userId-0001",
    includeLastAuthenticatedAt=nil,
    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('account')

api_result_handler = client.get_account_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    includeLastAuthenticatedAt=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
item = result.item;

```



---

### deleteAccount

ゲームプレイヤーアカウントを削除<br>

特定のゲームプレイヤーアカウントを削除するために使用されます。<br>
アカウントを削除すると、そのアカウントでログインできなくなりますが、GS2-Account が管理していないユーザーデータについては引き続きGS2に残り続けます。<br>
ユーザーデータも全て削除する必要がある場合は、マネージメントコンソールからアクセスできるユーザーデータの完全削除機能を利用してください。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | 削除したゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteAccount(
    &account.DeleteAccountRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteAccountRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteAccount(
        (new DeleteAccountRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteAccountRequest;
import io.gs2.account.result.DeleteAccountResult;

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

try {
    DeleteAccountResult result = client.deleteAccount(
        new DeleteAccountRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffsetToken(null)
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteAccountResult> asyncResult = null;
yield return client.DeleteAccount(
    new Gs2.Gs2Account.Request.DeleteAccountRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deleteAccount(
        new Gs2Account.DeleteAccountRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_account(
        account.DeleteAccountRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_account({
    namespaceName="namespace-0001",
    userId="userId-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('account')

api_result_handler = client.delete_account_async({
    namespaceName="namespace-0001",
    userId="userId-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;

```



---

### authentication

ゲームプレイヤーアカウントを認証<br>

ゲームプレイヤーアカウントの認証に使用されます。<br>
ユーザーがアカウントにログインする際に、ユーザー名とパスワードの照合を行います。<br>
正しい認証情報が提供されると、アカウント情報とその署名が発行されます。<br>
この情報を GS2-Auth に渡すことで、アクセストークンを得ることができ、GS2 が提供する様々なマイクロサービスにログインしたユーザーとしてアクセスすることができます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024文字 | 暗号鍵GRN |
| password | string |  | ✓|  |  ~ 128文字 | パスワード<br>アカウントのセキュリティを確保するためのパスワードを格納します。<br>パスワードは最大128文字の長さを持ち、アカウントの保護に重要な役割を果たします。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | ゲームプレイヤーアカウント |
| banStatuses | [List&lt;BanStatus&gt;](#banstatus) | BAN状態リスト |
| body | string | 署名対象のアカウント認証情報 |
| signature | string | 署名 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.Authentication(
    &account.AuthenticationRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        KeyId: pointy.String("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001"),
        Password: pointy.String("password-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
banStatuses := result.BanStatuses
body := result.Body
signature := result.Signature

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\AuthenticationRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->authentication(
        (new AuthenticationRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
            ->withPassword("password-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $banStatuses = $result->getBanStatuses();
    $body = $result->getBody();
    $signature = $result->getSignature();
} 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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.AuthenticationRequest;
import io.gs2.account.result.AuthenticationResult;

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

try {
    AuthenticationResult result = client.authentication(
        new AuthenticationRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
    List<BanStatus> banStatuses = result.getBanStatuses();
    String body = result.getBody();
    String signature = result.getSignature();
} 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.AuthenticationResult> asyncResult = null;
yield return client.Authentication(
    new Gs2.Gs2Account.Request.AuthenticationRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
        .WithPassword("password-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var banStatuses = result.BanStatuses;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

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

try {
    const result = await client.authentication(
        new Gs2Account.AuthenticationRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const banStatuses = result.getBanStatuses();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.authentication(
        account.AuthenticationRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_key_id('grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001')
            .with_password('password-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    ban_statuses = result.ban_statuses
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.authentication({
    namespaceName="namespace-0001",
    userId="user-0001",
    keyId="grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001",
    password="password-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;
banStatuses = result.banStatuses;
body = result.body;
signature = result.signature;

```

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

client = gs2('account')

api_result_handler = client.authentication_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    keyId="grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001",
    password="password-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;
banStatuses = result.banStatuses;
body = result.body;
signature = result.signature;

```



---

### describeTakeOvers

引き継ぎ情報の一覧を取得<br>

現在ログインしているゲームプレイヤーアカウントに登録されている引き継ぎ情報の一覧を取得します。<br>
引き継ぎ情報は、機種変更やゲームの再インストール時にアカウントデータを移行するために使用されます。<br>
ページネーションをサポートしており、一度に取得する件数を制限し、次のページのトークンを使って続きを取得できます。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;TakeOver&gt;](#takeover) | 引き継ぎ情報のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeTakeOvers(
    &account.DescribeTakeOversRequest {
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOversRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeTakeOvers(
        (new DescribeTakeOversRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOversRequest;
import io.gs2.account.result.DescribeTakeOversResult;

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

try {
    DescribeTakeOversResult result = client.describeTakeOvers(
        new DescribeTakeOversRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<TakeOver> 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOversResult> asyncResult = null;
yield return client.DescribeTakeOvers(
    new Gs2.Gs2Account.Request.DescribeTakeOversRequest()
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.describeTakeOvers(
        new Gs2Account.DescribeTakeOversRequest()
            .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 account

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

try:
    result = client.describe_take_overs(
        account.DescribeTakeOversRequest()
            .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('account')

api_result = client.describe_take_overs({
    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('account')

api_result_handler = client.describe_take_overs_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;

```



---

### describeTakeOversByUserId

ユーザーIDを指定して引き継ぎ情報の一覧を取得<br>

指定されたゲームプレイヤーアカウントに登録されている引き継ぎ情報の一覧を取得します。<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;TakeOver&gt;](#takeover) | 引き継ぎ情報のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeTakeOversByUserId(
    &account.DescribeTakeOversByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOversByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeTakeOversByUserId(
        (new DescribeTakeOversByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOversByUserIdRequest;
import io.gs2.account.result.DescribeTakeOversByUserIdResult;

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

try {
    DescribeTakeOversByUserIdResult result = client.describeTakeOversByUserId(
        new DescribeTakeOversByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<TakeOver> 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOversByUserIdResult> asyncResult = null;
yield return client.DescribeTakeOversByUserId(
    new Gs2.Gs2Account.Request.DescribeTakeOversByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.describeTakeOversByUserId(
        new Gs2Account.DescribeTakeOversByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-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 account

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

try:
    result = client.describe_take_overs_by_user_id(
        account.DescribeTakeOversByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-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('account')

api_result = client.describe_take_overs_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-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('account')

api_result_handler = client.describe_take_overs_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-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;

```



---

### createTakeOver

引き継ぎ情報を新規作成<br>

現在ログインしているゲームプレイヤーアカウントに新しい引き継ぎ情報を登録します。<br>
タイプスロット（数値）、ユーザー識別子（メールアドレスなど）、パスワードを指定する必要があります。<br>
登録した情報は、後に別の端末で同じユーザー識別子とパスワードを使ってアカウントを復旧する際に使用されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| userIdentifier | string |  | ✓|  |  ~ 1024文字 | 引き継ぎ用ユーザーID<br>アカウントを引き継ぐ際に使用される個人を識別するためのユニークなキーです。<br>異なるアカウントで同一の userIdentifier を指定した場合、後で設定した値が優先されます。 |
| password | string |  | ✓|  |  ~ 128文字 | パスワード<br>セキュリティを考慮して、このパスワードは機密情報として扱われ、ハッシュ値のみ保存されAPIの応答には値が含まれません。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 作成した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateTakeOver(
    &account.CreateTakeOverRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
        Password: pointy.String("password-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createTakeOver(
        (new CreateTakeOverRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
            ->withPassword("password-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverRequest;
import io.gs2.account.result.CreateTakeOverResult;

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

try {
    CreateTakeOverResult result = client.createTakeOver(
        new CreateTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverResult> asyncResult = null;
yield return client.CreateTakeOver(
    new Gs2.Gs2Account.Request.CreateTakeOverRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io")
        .WithPassword("password-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createTakeOver(
        new Gs2Account.CreateTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_take_over(
        account.CreateTakeOverRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
            .with_password('password-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_take_over({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-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('account')

api_result_handler = client.create_take_over_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-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;

```



---

### createTakeOverByUserId

ユーザーIDを指定して引き継ぎ情報を新規作成<br>

指定されたゲームプレイヤーアカウントに新しい引き継ぎ情報を登録します。<br>
タイプスロット（数値）、ユーザー識別子（メールアドレスなど）、パスワードを指定する必要があります。<br>
登録した情報は、後に別の端末で同じユーザー識別子とパスワードを使ってアカウントを復旧する際に使用されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| userIdentifier | string |  | ✓|  |  ~ 1024文字 | 引き継ぎ用ユーザーID<br>アカウントを引き継ぐ際に使用される個人を識別するためのユニークなキーです。<br>異なるアカウントで同一の userIdentifier を指定した場合、後で設定した値が優先されます。 |
| password | string |  | ✓|  |  ~ 128文字 | パスワード<br>セキュリティを考慮して、このパスワードは機密情報として扱われ、ハッシュ値のみ保存されAPIの応答には値が含まれません。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 作成した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateTakeOverByUserId(
    &account.CreateTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
        Password: pointy.String("password-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createTakeOverByUserId(
        (new CreateTakeOverByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
            ->withPassword("password-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverByUserIdRequest;
import io.gs2.account.result.CreateTakeOverByUserIdResult;

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

try {
    CreateTakeOverByUserIdResult result = client.createTakeOverByUserId(
        new CreateTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverByUserIdResult> asyncResult = null;
yield return client.CreateTakeOverByUserId(
    new Gs2.Gs2Account.Request.CreateTakeOverByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io")
        .WithPassword("password-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createTakeOverByUserId(
        new Gs2Account.CreateTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_take_over_by_user_id(
        account.CreateTakeOverByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
            .with_password('password-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_take_over_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-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('account')

api_result_handler = client.create_take_over_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-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;

```



---

### createTakeOverOpenIdConnect

OpenID Connect を使用して引き継ぎ情報を新規作成<br>

OpenID Connect の ID Token を使用して、現在ログインしているゲームプレイヤーアカウントに新しい引き継ぎ情報を登録します。<br>
パスワードの代わりに、ID プロバイダー（Google、Apple など）から取得した ID Token を使用します。<br>
ユーザー識別子（subject）は ID Token から自動的に抽出され、アカウントに紐付けられます。<br>
対応する引き継ぎタイプモデルに OpenID Connect の設定があらかじめ構成されている必要があります。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| idToken | string |  | ✓|  |  ~ 10240文字 | OpenID Connect ID Token |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 作成した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateTakeOverOpenIdConnect(
    &account.CreateTakeOverOpenIdConnectRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: pointy.Int32(0),
        IdToken: pointy.String("0123456789"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverOpenIdConnectRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createTakeOverOpenIdConnect(
        (new CreateTakeOverOpenIdConnectRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(0)
            ->withIdToken("0123456789")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverOpenIdConnectRequest;
import io.gs2.account.result.CreateTakeOverOpenIdConnectResult;

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

try {
    CreateTakeOverOpenIdConnectResult result = client.createTakeOverOpenIdConnect(
        new CreateTakeOverOpenIdConnectRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withIdToken("0123456789")
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverOpenIdConnectResult> asyncResult = null;
yield return client.CreateTakeOverOpenIdConnect(
    new Gs2.Gs2Account.Request.CreateTakeOverOpenIdConnectRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(0)
        .WithIdToken("0123456789"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createTakeOverOpenIdConnect(
        new Gs2Account.CreateTakeOverOpenIdConnectRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withIdToken("0123456789")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_take_over_open_id_connect(
        account.CreateTakeOverOpenIdConnectRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
            .with_id_token('0123456789')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_take_over_open_id_connect({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    idToken="0123456789",
})

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('account')

api_result_handler = client.create_take_over_open_id_connect_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    idToken="0123456789",
})

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;

```



---

### createTakeOverOpenIdConnectAndByUserId

ユーザーIDを指定して OpenID Connect を使用して引き継ぎ情報を新規作成<br>

OpenID Connect の ID Token を使用して、指定されたゲームプレイヤーアカウントに新しい引き継ぎ情報を登録します。<br>
パスワードの代わりに、ID プロバイダー（Google、Apple など）から取得した ID Token を使用します。<br>
ユーザー識別子（subject）は ID Token から自動的に抽出され、アカウントに紐付けられます。<br>
対応する引き継ぎタイプモデルに OpenID Connect の設定があらかじめ構成されている必要があります。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| idToken | string |  | ✓|  |  ~ 10240文字 | OpenID Connect ID Token |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 作成した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateTakeOverOpenIdConnectAndByUserId(
    &account.CreateTakeOverOpenIdConnectAndByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Type: pointy.Int32(0),
        IdToken: pointy.String("0123456789"),
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverOpenIdConnectAndByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createTakeOverOpenIdConnectAndByUserId(
        (new CreateTakeOverOpenIdConnectAndByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withType(0)
            ->withIdToken("0123456789")
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverOpenIdConnectAndByUserIdRequest;
import io.gs2.account.result.CreateTakeOverOpenIdConnectAndByUserIdResult;

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

try {
    CreateTakeOverOpenIdConnectAndByUserIdResult result = client.createTakeOverOpenIdConnectAndByUserId(
        new CreateTakeOverOpenIdConnectAndByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withIdToken("0123456789")
            .withTimeOffsetToken(null)
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverOpenIdConnectAndByUserIdResult> asyncResult = null;
yield return client.CreateTakeOverOpenIdConnectAndByUserId(
    new Gs2.Gs2Account.Request.CreateTakeOverOpenIdConnectAndByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithType(0)
        .WithIdToken("0123456789")
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createTakeOverOpenIdConnectAndByUserId(
        new Gs2Account.CreateTakeOverOpenIdConnectAndByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withIdToken("0123456789")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_take_over_open_id_connect_and_by_user_id(
        account.CreateTakeOverOpenIdConnectAndByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_type(0)
            .with_id_token('0123456789')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_take_over_open_id_connect_and_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    idToken="0123456789",
    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('account')

api_result_handler = client.create_take_over_open_id_connect_and_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    idToken="0123456789",
    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;

```



---

### getTakeOver

引き継ぎ情報を取得<br>

現在ログインしているゲームプレイヤーアカウントに登録されている、指定されたタイプの引き継ぎ情報を取得します。<br>
取得される情報には、タイプスロット、ユーザー識別子、作成日時などが含まれます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetTakeOver(
    &account.GetTakeOverRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getTakeOver(
        (new GetTakeOverRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverRequest;
import io.gs2.account.result.GetTakeOverResult;

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

try {
    GetTakeOverResult result = client.getTakeOver(
        new GetTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetTakeOverResult> asyncResult = null;
yield return client.GetTakeOver(
    new Gs2.Gs2Account.Request.GetTakeOverRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getTakeOver(
        new Gs2Account.GetTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_take_over(
        account.GetTakeOverRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_take_over({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=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('account')

api_result_handler = client.get_take_over_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=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;

```



---

### getTakeOverByUserId

ユーザーIDを指定して引き継ぎ情報を取得<br>

指定されたゲームプレイヤーアカウントに登録されている、指定されたタイプの引き継ぎ情報を取得します。<br>
取得される情報には、タイプスロット、ユーザー識別子、作成日時などが含まれます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetTakeOverByUserId(
    &account.GetTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getTakeOverByUserId(
        (new GetTakeOverByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverByUserIdRequest;
import io.gs2.account.result.GetTakeOverByUserIdResult;

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

try {
    GetTakeOverByUserIdResult result = client.getTakeOverByUserId(
        new GetTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetTakeOverByUserIdResult> asyncResult = null;
yield return client.GetTakeOverByUserId(
    new Gs2.Gs2Account.Request.GetTakeOverByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getTakeOverByUserId(
        new Gs2Account.GetTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_take_over_by_user_id(
        account.GetTakeOverByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_type(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_take_over_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=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('account')

api_result_handler = client.get_take_over_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=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;

```



---

### updateTakeOver

引き継ぎ情報を更新<br>

現在ログインしているゲームプレイヤーアカウントの指定されたタイプの引き継ぎ情報のパスワードを更新します。<br>
新しいパスワードを設定する前に、古いパスワードの検証が必要です。<br>
古いパスワードが一致しない場合、PasswordIncorrect エラーが返されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| oldPassword | string |  | ✓|  |  ~ 128文字 | 古いパスワード |
| password | string |  | ✓|  |  ~ 128文字 | パスワード<br>セキュリティを考慮して、このパスワードは機密情報として扱われ、ハッシュ値のみ保存されAPIの応答には値が含まれません。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 更新した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateTakeOver(
    &account.UpdateTakeOverRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: pointy.Int32(0),
        OldPassword: pointy.String("password-0001"),
        Password: pointy.String("password-1001"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateTakeOver(
        (new UpdateTakeOverRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(0)
            ->withOldPassword("password-0001")
            ->withPassword("password-1001")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverRequest;
import io.gs2.account.result.UpdateTakeOverResult;

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

try {
    UpdateTakeOverResult result = client.updateTakeOver(
        new UpdateTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-1001")
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverResult> asyncResult = null;
yield return client.UpdateTakeOver(
    new Gs2.Gs2Account.Request.UpdateTakeOverRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(0)
        .WithOldPassword("password-0001")
        .WithPassword("password-1001"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateTakeOver(
        new Gs2Account.UpdateTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-1001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.update_take_over(
        account.UpdateTakeOverRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
            .with_old_password('password-0001')
            .with_password('password-1001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.update_take_over({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    oldPassword="password-0001",
    password="password-1001",
})

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('account')

api_result_handler = client.update_take_over_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    oldPassword="password-0001",
    password="password-1001",
})

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;

```



---

### updateTakeOverByUserId

ユーザーIDを指定して引き継ぎ情報を更新<br>

指定されたゲームプレイヤーアカウントの指定されたタイプの引き継ぎ情報のパスワードを更新します。<br>
新しいパスワードを設定する前に、古いパスワードの検証が必要です。<br>
古いパスワードが一致しない場合、PasswordIncorrect エラーが返されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| oldPassword | string |  | ✓|  |  ~ 128文字 | 古いパスワード |
| password | string |  | ✓|  |  ~ 128文字 | パスワード<br>セキュリティを考慮して、このパスワードは機密情報として扱われ、ハッシュ値のみ保存されAPIの応答には値が含まれません。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 更新した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateTakeOverByUserId(
    &account.UpdateTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Type: pointy.Int32(0),
        OldPassword: pointy.String("password-0001"),
        Password: pointy.String("password-0002"),
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateTakeOverByUserId(
        (new UpdateTakeOverByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withType(0)
            ->withOldPassword("password-0001")
            ->withPassword("password-0002")
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverByUserIdRequest;
import io.gs2.account.result.UpdateTakeOverByUserIdResult;

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

try {
    UpdateTakeOverByUserIdResult result = client.updateTakeOverByUserId(
        new UpdateTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-0002")
            .withTimeOffsetToken(null)
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverByUserIdResult> asyncResult = null;
yield return client.UpdateTakeOverByUserId(
    new Gs2.Gs2Account.Request.UpdateTakeOverByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithType(0)
        .WithOldPassword("password-0001")
        .WithPassword("password-0002")
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateTakeOverByUserId(
        new Gs2Account.UpdateTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.update_take_over_by_user_id(
        account.UpdateTakeOverByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_type(0)
            .with_old_password('password-0001')
            .with_password('password-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.update_take_over_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    oldPassword="password-0001",
    password="password-0002",
    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('account')

api_result_handler = client.update_take_over_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    oldPassword="password-0001",
    password="password-0002",
    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;

```



---

### deleteTakeOver

引き継ぎ情報を削除<br>

現在ログインしているゲームプレイヤーアカウントから、指定されたタイプの引き継ぎ情報を削除します。<br>
削除後は、削除された引き継ぎ情報のユーザー識別子とパスワードを使ったアカウントの復旧はできなくなります。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 削除した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteTakeOver(
    &account.DeleteTakeOverRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTakeOver(
        (new DeleteTakeOverRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverRequest;
import io.gs2.account.result.DeleteTakeOverResult;

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

try {
    DeleteTakeOverResult result = client.deleteTakeOver(
        new DeleteTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverResult> asyncResult = null;
yield return client.DeleteTakeOver(
    new Gs2.Gs2Account.Request.DeleteTakeOverRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deleteTakeOver(
        new Gs2Account.DeleteTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_take_over(
        account.DeleteTakeOverRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_take_over({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=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('account')

api_result_handler = client.delete_take_over_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=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;

```



---

### deleteTakeOverByUserIdentifier

引き継ぎ用ユーザーIDを指定して引き継ぎ情報を削除<br>

GS2 のユーザーIDではなく、プラットフォーム側のユーザー識別子を使用して引き継ぎ情報を検索し削除します。<br>
内部の GS2 ユーザーIDがわからない場合でも、外部のユーザー識別子（メールアドレスなど）で削除できます。<br>
削除後は、削除された引き継ぎ情報のユーザー識別子とパスワードを使ったアカウントの復旧はできなくなります。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| userIdentifier | string |  | |  |  ~ 1024文字 | 引き継ぎ用ユーザーID |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 削除した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteTakeOverByUserIdentifier(
    &account.DeleteTakeOverByUserIdentifierRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverByUserIdentifierRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTakeOverByUserIdentifier(
        (new DeleteTakeOverByUserIdentifierRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverByUserIdentifierRequest;
import io.gs2.account.result.DeleteTakeOverByUserIdentifierResult;

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

try {
    DeleteTakeOverByUserIdentifierResult result = client.deleteTakeOverByUserIdentifier(
        new DeleteTakeOverByUserIdentifierRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverByUserIdentifierResult> asyncResult = null;
yield return client.DeleteTakeOverByUserIdentifier(
    new Gs2.Gs2Account.Request.DeleteTakeOverByUserIdentifierRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deleteTakeOverByUserIdentifier(
        new Gs2Account.DeleteTakeOverByUserIdentifierRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_take_over_by_user_identifier(
        account.DeleteTakeOverByUserIdentifierRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_take_over_by_user_identifier({
    namespaceName="namespace-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
})

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('account')

api_result_handler = client.delete_take_over_by_user_identifier_async({
    namespaceName="namespace-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
})

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;

```



---

### deleteTakeOverByUserId

ユーザーIDを指定して引き継ぎ情報を削除<br>

GS2 ユーザーIDを使用して、指定されたゲームプレイヤーアカウントから指定されたタイプの引き継ぎ情報を削除します。<br>
削除後は、削除された引き継ぎ情報のユーザー識別子とパスワードを使ったアカウントの復旧はできなくなります。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOver](#takeover) | 削除した引き継ぎ情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteTakeOverByUserId(
    &account.DeleteTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTakeOverByUserId(
        (new DeleteTakeOverByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverByUserIdRequest;
import io.gs2.account.result.DeleteTakeOverByUserIdResult;

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

try {
    DeleteTakeOverByUserIdResult result = client.deleteTakeOverByUserId(
        new DeleteTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    TakeOver 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverByUserIdResult> asyncResult = null;
yield return client.DeleteTakeOverByUserId(
    new Gs2.Gs2Account.Request.DeleteTakeOverByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deleteTakeOverByUserId(
        new Gs2Account.DeleteTakeOverByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_take_over_by_user_id(
        account.DeleteTakeOverByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_type(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_take_over_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=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('account')

api_result_handler = client.delete_take_over_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=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;

```



---

### doTakeOver

引き継ぎを実行<br>

ユーザー識別子とパスワードを使用してアカウントの引き継ぎ（復旧）処理を実行します。<br>
機種変更やゲームの再インストール後にアカウントを復旧したい場合に使用します。<br>
ユーザー識別子とパスワードが登録済みの引き継ぎ情報と一致する場合、関連するゲームプレイヤーアカウントが返されます。<br>
パスワードが一致しない場合、PasswordIncorrect エラーが返されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| userIdentifier | string |  | ✓|  |  ~ 1024文字 | 引き継ぎ用ユーザーID<br>アカウントを引き継ぐ際に使用される個人を識別するためのユニークなキーです。<br>異なるアカウントで同一の userIdentifier を指定した場合、後で設定した値が優先されます。 |
| password | string |  | ✓|  |  ~ 128文字 | パスワード<br>セキュリティを考慮して、このパスワードは機密情報として扱われ、ハッシュ値のみ保存されAPIの応答には値が含まれません。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | ゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DoTakeOver(
    &account.DoTakeOverRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
        Password: pointy.String("password-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DoTakeOverRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->doTakeOver(
        (new DoTakeOverRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
            ->withPassword("password-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DoTakeOverRequest;
import io.gs2.account.result.DoTakeOverResult;

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

try {
    DoTakeOverResult result = client.doTakeOver(
        new DoTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DoTakeOverResult> asyncResult = null;
yield return client.DoTakeOver(
    new Gs2.Gs2Account.Request.DoTakeOverRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io")
        .WithPassword("password-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.doTakeOver(
        new Gs2Account.DoTakeOverRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.do_take_over(
        account.DoTakeOverRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
            .with_password('password-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.do_take_over({
    namespaceName="namespace-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-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('account')

api_result_handler = client.do_take_over_async({
    namespaceName="namespace-0001",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-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;

```



---

### doTakeOverOpenIdConnect

OpenID Connect を使用して引き継ぎを実行<br>

OpenID Connect の ID Token を使用してアカウントの引き継ぎ（復旧）処理を実行します。<br>
パスワードの代わりに、ID プロバイダー（Google、Apple など）から取得した ID Token を使用する引き継ぎ実行の OIDC バリアントです。<br>
ID Token が検証され、subject を使用して関連するゲームプレイヤーアカウントが検索されます。<br>
対応する引き継ぎタイプモデルに OpenID Connect の設定があらかじめ構成されている必要があります。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| idToken | string |  | ✓|  |  ~ 10240文字 | OpenID Connect ID Token |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Account](#account) | ゲームプレイヤーアカウント |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DoTakeOverOpenIdConnect(
    &account.DoTakeOverOpenIdConnectRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: nil,
        IdToken: pointy.String("0123456789"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DoTakeOverOpenIdConnectRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->doTakeOverOpenIdConnect(
        (new DoTakeOverOpenIdConnectRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(null)
            ->withIdToken("0123456789")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DoTakeOverOpenIdConnectRequest;
import io.gs2.account.result.DoTakeOverOpenIdConnectResult;

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

try {
    DoTakeOverOpenIdConnectResult result = client.doTakeOverOpenIdConnect(
        new DoTakeOverOpenIdConnectRequest()
            .withNamespaceName("namespace-0001")
            .withType(null)
            .withIdToken("0123456789")
    );
    Account 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DoTakeOverOpenIdConnectResult> asyncResult = null;
yield return client.DoTakeOverOpenIdConnect(
    new Gs2.Gs2Account.Request.DoTakeOverOpenIdConnectRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(null)
        .WithIdToken("0123456789"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.doTakeOverOpenIdConnect(
        new Gs2Account.DoTakeOverOpenIdConnectRequest()
            .withNamespaceName("namespace-0001")
            .withType(null)
            .withIdToken("0123456789")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.do_take_over_open_id_connect(
        account.DoTakeOverOpenIdConnectRequest()
            .with_namespace_name('namespace-0001')
            .with_type(None)
            .with_id_token('0123456789')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.do_take_over_open_id_connect({
    namespaceName="namespace-0001",
    type=nil,
    idToken="0123456789",
})

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('account')

api_result_handler = client.do_take_over_open_id_connect_async({
    namespaceName="namespace-0001",
    type=nil,
    idToken="0123456789",
})

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;

```



---

### getAuthorizationUrl

認証URLを取得<br>

指定された引き継ぎタイプの OpenID Connect フローの認証URLを返します。<br>
クライアントはこのURLを使用して、ユーザーを ID プロバイダーの認証ページにリダイレクトできます。<br>
これは、アカウント引き継ぎのための OAuth/OIDC 認証フローを開始するエントリポイントです。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| authorizationUrl | string | 認証URL |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetAuthorizationUrl(
    &account.GetAuthorizationUrlRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
authorizationUrl := result.AuthorizationUrl

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetAuthorizationUrlRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getAuthorizationUrl(
        (new GetAuthorizationUrlRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(0)
    );
    $authorizationUrl = $result->getAuthorizationUrl();
} 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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetAuthorizationUrlRequest;
import io.gs2.account.result.GetAuthorizationUrlResult;

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

try {
    GetAuthorizationUrlResult result = client.getAuthorizationUrl(
        new GetAuthorizationUrlRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    String authorizationUrl = result.getAuthorizationUrl();
} 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetAuthorizationUrlResult> asyncResult = null;
yield return client.GetAuthorizationUrl(
    new Gs2.Gs2Account.Request.GetAuthorizationUrlRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(0),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var authorizationUrl = result.AuthorizationUrl;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getAuthorizationUrl(
        new Gs2Account.GetAuthorizationUrlRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    const authorizationUrl = result.getAuthorizationUrl();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_authorization_url(
        account.GetAuthorizationUrlRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
    )
    authorization_url = result.authorization_url
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_authorization_url({
    namespaceName="namespace-0001",
    type=0,
})

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

result = api_result.result
authorizationUrl = result.authorizationUrl;

```

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

client = gs2('account')

api_result_handler = client.get_authorization_url_async({
    namespaceName="namespace-0001",
    type=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
authorizationUrl = result.authorizationUrl;

```



---

### describePlatformIds

外部プラットフォームのアカウントIDの一覧を取得


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;PlatformId&gt;](#platformid) | 外部プラットフォームアカウントIDのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribePlatformIds(
    &account.DescribePlatformIdsRequest {
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribePlatformIdsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describePlatformIds(
        (new DescribePlatformIdsRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribePlatformIdsRequest;
import io.gs2.account.result.DescribePlatformIdsResult;

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

try {
    DescribePlatformIdsResult result = client.describePlatformIds(
        new DescribePlatformIdsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<PlatformId> 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribePlatformIdsResult> asyncResult = null;
yield return client.DescribePlatformIds(
    new Gs2.Gs2Account.Request.DescribePlatformIdsRequest()
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.describePlatformIds(
        new Gs2Account.DescribePlatformIdsRequest()
            .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 account

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

try:
    result = client.describe_platform_ids(
        account.DescribePlatformIdsRequest()
            .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('account')

api_result = client.describe_platform_ids({
    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('account')

api_result_handler = client.describe_platform_ids_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;

```



---

### describePlatformIdsByUserId

GS2-Account ユーザーID を指定して 外部プラットフォームのアカウントID の一覧を取得


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;PlatformId&gt;](#platformid) | 外部プラットフォームアカウントIDのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribePlatformIdsByUserId(
    &account.DescribePlatformIdsByUserIdRequest {
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribePlatformIdsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describePlatformIdsByUserId(
        (new DescribePlatformIdsByUserIdRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribePlatformIdsByUserIdRequest;
import io.gs2.account.result.DescribePlatformIdsByUserIdResult;

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

try {
    DescribePlatformIdsByUserIdResult result = client.describePlatformIdsByUserId(
        new DescribePlatformIdsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<PlatformId> 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribePlatformIdsByUserIdResult> asyncResult = null;
yield return client.DescribePlatformIdsByUserId(
    new Gs2.Gs2Account.Request.DescribePlatformIdsByUserIdRequest()
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.describePlatformIdsByUserId(
        new Gs2Account.DescribePlatformIdsByUserIdRequest()
            .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 account

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

try:
    result = client.describe_platform_ids_by_user_id(
        account.DescribePlatformIdsByUserIdRequest()
            .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('account')

api_result = client.describe_platform_ids_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('account')

api_result_handler = client.describe_platform_ids_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;

```



---

### createPlatformId

外部プラットフォームのアカウントIDを新規作成<br>

外部プラットフォームのアカウントIDとは、X、Instagram、Facebook などの外部プラットフォームにおけるIDを保持するための情報です。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | ✓|  |  ~ 1024文字 | 外部プラットフォームのユーザーID<br>外部プラットフォームにおけるユーザーの一意な識別子（例：ソーシャルメディアのユーザーIDやメールアドレス）です。`type`(スロット番号)と組み合わせて、特定のプラットフォームアカウントを識別するために使用されます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformId](#platformid) | 作成した外部プラットフォームのアカウントID |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreatePlatformId(
    &account.CreatePlatformIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("123456"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreatePlatformIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createPlatformId(
        (new CreatePlatformIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(0)
            ->withUserIdentifier("123456")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreatePlatformIdRequest;
import io.gs2.account.result.CreatePlatformIdResult;

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

try {
    CreatePlatformIdResult result = client.createPlatformId(
        new CreatePlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("123456")
    );
    PlatformId 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreatePlatformIdResult> asyncResult = null;
yield return client.CreatePlatformId(
    new Gs2.Gs2Account.Request.CreatePlatformIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(0)
        .WithUserIdentifier("123456"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createPlatformId(
        new Gs2Account.CreatePlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("123456")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_platform_id(
        account.CreatePlatformIdRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
            .with_user_identifier('123456')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_platform_id({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="123456",
})

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('account')

api_result_handler = client.create_platform_id_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="123456",
})

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;

```



---

### createPlatformIdByUserId

GS2-Account ユーザーIDを指定して外部プラットフォームのアカウントIDを新規作成


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | GS2-Account ユーザーID<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | ✓|  |  ~ 1024文字 | 外部プラットフォームのユーザーID<br>外部プラットフォームにおけるユーザーの一意な識別子（例：ソーシャルメディアのユーザーIDやメールアドレス）です。`type`(スロット番号)と組み合わせて、特定のプラットフォームアカウントを識別するために使用されます。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformId](#platformid) | 作成した外部プラットフォームのアカウントID |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreatePlatformIdByUserId(
    &account.CreatePlatformIdByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("123456789"),
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreatePlatformIdByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createPlatformIdByUserId(
        (new CreatePlatformIdByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withType(0)
            ->withUserIdentifier("123456789")
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreatePlatformIdByUserIdRequest;
import io.gs2.account.result.CreatePlatformIdByUserIdResult;

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

try {
    CreatePlatformIdByUserIdResult result = client.createPlatformIdByUserId(
        new CreatePlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withUserIdentifier("123456789")
            .withTimeOffsetToken(null)
    );
    PlatformId 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreatePlatformIdByUserIdResult> asyncResult = null;
yield return client.CreatePlatformIdByUserId(
    new Gs2.Gs2Account.Request.CreatePlatformIdByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithType(0)
        .WithUserIdentifier("123456789")
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createPlatformIdByUserId(
        new Gs2Account.CreatePlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withUserIdentifier("123456789")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_platform_id_by_user_id(
        account.CreatePlatformIdByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_type(0)
            .with_user_identifier('123456789')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_platform_id_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    userIdentifier="123456789",
    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('account')

api_result_handler = client.create_platform_id_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=0,
    userIdentifier="123456789",
    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;

```



---

### getPlatformId

外部プラットフォームのアカウントIDを取得


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformId](#platformid) | 外部プラットフォームのアカウントID |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetPlatformId(
    &account.GetPlatformIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetPlatformIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getPlatformId(
        (new GetPlatformIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetPlatformIdRequest;
import io.gs2.account.result.GetPlatformIdResult;

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

try {
    GetPlatformIdResult result = client.getPlatformId(
        new GetPlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
    );
    PlatformId 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetPlatformIdResult> asyncResult = null;
yield return client.GetPlatformId(
    new Gs2.Gs2Account.Request.GetPlatformIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getPlatformId(
        new Gs2Account.GetPlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_platform_id(
        account.GetPlatformIdRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_platform_id({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=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('account')

api_result_handler = client.get_platform_id_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=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;

```



---

### getPlatformIdByUserId

ユーザーIDを指定して外部プラットフォームのアカウントIDを取得


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | GS2-Account ユーザーID<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformId](#platformid) | 外部プラットフォームのアカウントID |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetPlatformIdByUserId(
    &account.GetPlatformIdByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetPlatformIdByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getPlatformIdByUserId(
        (new GetPlatformIdByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetPlatformIdByUserIdRequest;
import io.gs2.account.result.GetPlatformIdByUserIdResult;

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

try {
    GetPlatformIdByUserIdResult result = client.getPlatformIdByUserId(
        new GetPlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    PlatformId 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetPlatformIdByUserIdResult> asyncResult = null;
yield return client.GetPlatformIdByUserId(
    new Gs2.Gs2Account.Request.GetPlatformIdByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getPlatformIdByUserId(
        new Gs2Account.GetPlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_platform_id_by_user_id(
        account.GetPlatformIdByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_type(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_platform_id_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=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('account')

api_result_handler = client.get_platform_id_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    type=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;

```



---

### findPlatformId

外部プラットフォームのアカウントIDを指定してGS2-AccountのユーザーIDを取得<br>

ネームスペースの設定で「ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする」を有効にしている場合はデータオーナーIDを取得できます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | ✓|  |  ~ 1024文字 | 外部プラットフォームのユーザーID<br>外部プラットフォームにおけるユーザーの一意な識別子（例：ソーシャルメディアのユーザーIDやメールアドレス）です。`type`(スロット番号)と組み合わせて、特定のプラットフォームアカウントを識別するために使用されます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformUser](#platformuser) | 外部プラットフォームのユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.FindPlatformId(
    &account.FindPlatformIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("123456"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\FindPlatformIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->findPlatformId(
        (new FindPlatformIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(0)
            ->withUserIdentifier("123456")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.FindPlatformIdRequest;
import io.gs2.account.result.FindPlatformIdResult;

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

try {
    FindPlatformIdResult result = client.findPlatformId(
        new FindPlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("123456")
    );
    PlatformUser 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.FindPlatformIdResult> asyncResult = null;
yield return client.FindPlatformId(
    new Gs2.Gs2Account.Request.FindPlatformIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(0)
        .WithUserIdentifier("123456"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.findPlatformId(
        new Gs2Account.FindPlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("123456")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.find_platform_id(
        account.FindPlatformIdRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
            .with_user_identifier('123456')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.find_platform_id({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="123456",
})

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('account')

api_result_handler = client.find_platform_id_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="123456",
})

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;

```



---

### findPlatformIdByUserId

GS2-Account ユーザーIDを指定して外部プラットフォームのアカウントIDを取得<br>

ネームスペースの設定で「ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする」を有効にしている場合はデータオーナーIDを取得できます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | GS2-Account ユーザーID<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | ✓|  |  ~ 1024文字 | 外部プラットフォームのユーザーID<br>外部プラットフォームにおけるユーザーの一意な識別子（例：ソーシャルメディアのユーザーIDやメールアドレス）です。`type`(スロット番号)と組み合わせて、特定のプラットフォームアカウントを識別するために使用されます。 |
| dontResolveDataOwner | bool? |  | | false |  | ログイン用とデータ保持用ユーザーIDを分離する場合にデータオーナーID解決を無効化<br>ネームスペースの設定で「ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする」を有効にしている場合でもデータオーナーIDを解決しないようにするには true を設定します。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformUser](#platformuser) | 外部プラットフォームのユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.FindPlatformIdByUserId(
    &account.FindPlatformIdByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("123456"),
        DontResolveDataOwner: nil,
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\FindPlatformIdByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->findPlatformIdByUserId(
        (new FindPlatformIdByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withType(0)
            ->withUserIdentifier("123456")
            ->withDontResolveDataOwner(null)
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.FindPlatformIdByUserIdRequest;
import io.gs2.account.result.FindPlatformIdByUserIdResult;

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

try {
    FindPlatformIdByUserIdResult result = client.findPlatformIdByUserId(
        new FindPlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withType(0)
            .withUserIdentifier("123456")
            .withDontResolveDataOwner(null)
            .withTimeOffsetToken(null)
    );
    PlatformUser 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.FindPlatformIdByUserIdResult> asyncResult = null;
yield return client.FindPlatformIdByUserId(
    new Gs2.Gs2Account.Request.FindPlatformIdByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithType(0)
        .WithUserIdentifier("123456")
        .WithDontResolveDataOwner(null)
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.findPlatformIdByUserId(
        new Gs2Account.FindPlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withType(0)
            .withUserIdentifier("123456")
            .withDontResolveDataOwner(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.find_platform_id_by_user_id(
        account.FindPlatformIdByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_type(0)
            .with_user_identifier('123456')
            .with_dont_resolve_data_owner(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.find_platform_id_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    type=0,
    userIdentifier="123456",
    dontResolveDataOwner=nil,
    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('account')

api_result_handler = client.find_platform_id_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    type=0,
    userIdentifier="123456",
    dontResolveDataOwner=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
item = result.item;

```



---

### deletePlatformId

外部プラットフォームのアカウントIDを削除<br>

現在ログインしているゲームプレイヤーアカウントから、指定されたタイプの外部プラットフォームのアカウントIDを削除します。<br>
削除後、GS2 アカウントとプラットフォーム上の ID との紐付けが解除されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | |  |  ~ 1024文字 | 外部プラットフォームのユーザーID |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformId](#platformid) | 削除した外部プラットフォームのアカウントID |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeletePlatformId(
    &account.DeletePlatformIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("123456"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeletePlatformIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deletePlatformId(
        (new DeletePlatformIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withType(0)
            ->withUserIdentifier("123456")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeletePlatformIdRequest;
import io.gs2.account.result.DeletePlatformIdResult;

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

try {
    DeletePlatformIdResult result = client.deletePlatformId(
        new DeletePlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("123456")
    );
    PlatformId 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeletePlatformIdResult> asyncResult = null;
yield return client.DeletePlatformId(
    new Gs2.Gs2Account.Request.DeletePlatformIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithType(0)
        .WithUserIdentifier("123456"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deletePlatformId(
        new Gs2Account.DeletePlatformIdRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withType(0)
            .withUserIdentifier("123456")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_platform_id(
        account.DeletePlatformIdRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_type(0)
            .with_user_identifier('123456')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_platform_id({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="123456",
})

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('account')

api_result_handler = client.delete_platform_id_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    type=0,
    userIdentifier="123456",
})

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;

```



---

### deletePlatformIdByUserIdentifier

外部プラットフォームのユーザーIDを指定して外部プラットフォームのアカウントIDを削除<br>

GS2 のユーザーIDではなく、プラットフォーム側のユーザー識別子を使用して外部プラットフォームのアカウントIDを検索し削除します。<br>
内部の GS2 ユーザーIDがわからない場合でも、外部プラットフォーム上のユーザー識別子で削除できます。<br>
削除後、GS2 アカウントと外部プラットフォーム上の ユーザーID との紐付けが解除されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| userIdentifier | string |  | |  |  ~ 1024文字 | 外部プラットフォームのユーザーID |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformId](#platformid) | 削除した外部プラットフォームのアカウントID |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeletePlatformIdByUserIdentifier(
    &account.DeletePlatformIdByUserIdentifierRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("123456789"),
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeletePlatformIdByUserIdentifierRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deletePlatformIdByUserIdentifier(
        (new DeletePlatformIdByUserIdentifierRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(0)
            ->withUserIdentifier("123456789")
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeletePlatformIdByUserIdentifierRequest;
import io.gs2.account.result.DeletePlatformIdByUserIdentifierResult;

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

try {
    DeletePlatformIdByUserIdentifierResult result = client.deletePlatformIdByUserIdentifier(
        new DeletePlatformIdByUserIdentifierRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withUserIdentifier("123456789")
    );
    PlatformId 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeletePlatformIdByUserIdentifierResult> asyncResult = null;
yield return client.DeletePlatformIdByUserIdentifier(
    new Gs2.Gs2Account.Request.DeletePlatformIdByUserIdentifierRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(0)
        .WithUserIdentifier("123456789"),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deletePlatformIdByUserIdentifier(
        new Gs2Account.DeletePlatformIdByUserIdentifierRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withUserIdentifier("123456789")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_platform_id_by_user_identifier(
        account.DeletePlatformIdByUserIdentifierRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
            .with_user_identifier('123456789')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_platform_id_by_user_identifier({
    namespaceName="namespace-0001",
    type=0,
    userIdentifier="123456789",
})

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('account')

api_result_handler = client.delete_platform_id_by_user_identifier_async({
    namespaceName="namespace-0001",
    type=0,
    userIdentifier="123456789",
})

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;

```



---

### deletePlatformIdByUserId

GS2-Account ユーザーIDを指定して外部プラットフォームのアカウントIDを削除<br>

GS2 ユーザーIDを使用して、指定されたゲームプレイヤーアカウントから指定されたタイプの外部プラットフォームのアカウントIDを削除します。<br>
削除後、GS2 アカウントとプラットフォーム上の ID との紐付けが解除されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | GS2-Account ユーザーID<br>この外部プラットフォームのアカウントIDにリンクされた GS2-Account のユーザーIDです。外部プラットフォームのIDと GS2-Account の匿名アカウントを対応付けるために使用されます。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、外部プラットフォームの種類を識別するために使用します。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [PlatformId](#platformid) | 削除した外部プラットフォームのアカウントID |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeletePlatformIdByUserId(
    &account.DeletePlatformIdByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeletePlatformIdByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deletePlatformIdByUserId(
        (new DeletePlatformIdByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeletePlatformIdByUserIdRequest;
import io.gs2.account.result.DeletePlatformIdByUserIdResult;

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

try {
    DeletePlatformIdByUserIdResult result = client.deletePlatformIdByUserId(
        new DeletePlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    PlatformId 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeletePlatformIdByUserIdResult> asyncResult = null;
yield return client.DeletePlatformIdByUserId(
    new Gs2.Gs2Account.Request.DeletePlatformIdByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deletePlatformIdByUserId(
        new Gs2Account.DeletePlatformIdByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_platform_id_by_user_id(
        account.DeletePlatformIdByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_type(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_platform_id_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    type=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('account')

api_result_handler = client.delete_platform_id_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    type=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;

```



---

### getDataOwnerByUserId

データオーナーを取得<br>

指定されたユーザーIDに関連付けられたデータオーナーの情報を取得するために使用されます。<br>
このアクションは、指定されたネームスペース内の特定のアカウントに紐づくデータオーナーの詳細情報を返します。<br>
データオーナー情報には、データオーナーID、関連するユーザーID、およびその他の関連情報が含まれます。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [DataOwner](#dataowner) | データオーナー |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetDataOwnerByUserId(
    &account.GetDataOwnerByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetDataOwnerByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getDataOwnerByUserId(
        (new GetDataOwnerByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetDataOwnerByUserIdRequest;
import io.gs2.account.result.GetDataOwnerByUserIdResult;

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

try {
    GetDataOwnerByUserIdResult result = client.getDataOwnerByUserId(
        new GetDataOwnerByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffsetToken(null)
    );
    DataOwner 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetDataOwnerByUserIdResult> asyncResult = null;
yield return client.GetDataOwnerByUserId(
    new Gs2.Gs2Account.Request.GetDataOwnerByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getDataOwnerByUserId(
        new Gs2Account.GetDataOwnerByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_data_owner_by_user_id(
        account.GetDataOwnerByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_data_owner_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-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('account')

api_result_handler = client.get_data_owner_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-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;

```



---

### updateDataOwnerByUserId

データオーナーIDを任意の値で更新<br>

指定されたユーザーIDに関連付けられたデータオーナー名を更新します。<br>
データオーナーは、ネームスペースの設定で「ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする」が有効な場合に、ログイン用ユーザーIDとデータ保持用ユーザーIDのマッピングを管理するために使用されます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓| UUID |  ~ 128文字 | ユーザーID |
| dataOwnerName | string |  | ✓| UUID |  ~ 36文字 | データオーナーID<br>データオーナーの一意な識別子として機能します。<br>データオーナーIDは、データの実際の所有者を表し、ユーザーIDとは異なる可能性があります。<br>このIDはシステムによって自動的に生成され、各データオーナーに対して一意です。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [DataOwner](#dataowner) | データオーナー |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateDataOwnerByUserId(
    &account.UpdateDataOwnerByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-0001"),
        DataOwnerName: pointy.String("data-owner-1001"),
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateDataOwnerByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateDataOwnerByUserId(
        (new UpdateDataOwnerByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-0001")
            ->withDataOwnerName("data-owner-1001")
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateDataOwnerByUserIdRequest;
import io.gs2.account.result.UpdateDataOwnerByUserIdResult;

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

try {
    UpdateDataOwnerByUserIdResult result = client.updateDataOwnerByUserId(
        new UpdateDataOwnerByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withDataOwnerName("data-owner-1001")
            .withTimeOffsetToken(null)
    );
    DataOwner 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateDataOwnerByUserIdResult> asyncResult = null;
yield return client.UpdateDataOwnerByUserId(
    new Gs2.Gs2Account.Request.UpdateDataOwnerByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-0001")
        .WithDataOwnerName("data-owner-1001")
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateDataOwnerByUserId(
        new Gs2Account.UpdateDataOwnerByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withDataOwnerName("data-owner-1001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.update_data_owner_by_user_id(
        account.UpdateDataOwnerByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_data_owner_name('data-owner-1001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.update_data_owner_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-0001",
    dataOwnerName="data-owner-1001",
    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('account')

api_result_handler = client.update_data_owner_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-0001",
    dataOwnerName="data-owner-1001",
    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;

```



---

### deleteDataOwnerByUserId

データオーナーを削除<br>

特定のユーザーIDに関連付けられたデータオーナーの情報を削除するために使用されます。<br>
このアクションは、指定されたネームスペース内のアカウントに関連するデータオーナーをシステムから完全に削除します。<br>
ユーザーIDとデータオーナーIDの関連性が失われ、GS2 が管理するユーザーデータ内にユーザーIDが含まれない限り誰のデータかが不明な状態になります。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [DataOwner](#dataowner) | 削除したデータオーナー |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteDataOwnerByUserId(
    &account.DeleteDataOwnerByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("userId-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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteDataOwnerByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteDataOwnerByUserId(
        (new DeleteDataOwnerByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("userId-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteDataOwnerByUserIdRequest;
import io.gs2.account.result.DeleteDataOwnerByUserIdResult;

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

try {
    DeleteDataOwnerByUserIdResult result = client.deleteDataOwnerByUserId(
        new DeleteDataOwnerByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffsetToken(null)
    );
    DataOwner 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteDataOwnerByUserIdResult> asyncResult = null;
yield return client.DeleteDataOwnerByUserId(
    new Gs2.Gs2Account.Request.DeleteDataOwnerByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("userId-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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deleteDataOwnerByUserId(
        new Gs2Account.DeleteDataOwnerByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("userId-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_data_owner_by_user_id(
        account.DeleteDataOwnerByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('userId-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_data_owner_by_user_id({
    namespaceName="namespace-0001",
    userId="userId-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('account')

api_result_handler = client.delete_data_owner_by_user_id_async({
    namespaceName="namespace-0001",
    userId="userId-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;

```



---

### describeTakeOverTypeModels

引き継ぎ情報タイプモデルの一覧を取得<br>

指定されたネームスペースで現在有効化されているすべての引き継ぎ情報タイプモデルを取得します。<br>
引き継ぎ情報タイプモデルは、メール/パスワードベースや OpenID Connect ベースの引き継ぎなど、利用可能なアカウント引き継ぎ方法の種類を定義します。<br>
各タイプモデルには、ID プロバイダーの OpenID Connect 設定などが含まれます。<br>
マスター版とは異なり、有効化（公開）済みのモデルのみを返し、ページネーションはありません。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;TakeOverTypeModel&gt;](#takeovertypemodel) | 引き継ぎ情報タイプモデルのリスト |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeTakeOverTypeModels(
    &account.DescribeTakeOverTypeModelsRequest {
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOverTypeModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeTakeOverTypeModels(
        (new DescribeTakeOverTypeModelsRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOverTypeModelsRequest;
import io.gs2.account.result.DescribeTakeOverTypeModelsResult;

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

try {
    DescribeTakeOverTypeModelsResult result = client.describeTakeOverTypeModels(
        new DescribeTakeOverTypeModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<TakeOverTypeModel> 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOverTypeModelsResult> asyncResult = null;
yield return client.DescribeTakeOverTypeModels(
    new Gs2.Gs2Account.Request.DescribeTakeOverTypeModelsRequest()
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.describeTakeOverTypeModels(
        new Gs2Account.DescribeTakeOverTypeModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.describe_take_over_type_models(
        account.DescribeTakeOverTypeModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.describe_take_over_type_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('account')

api_result_handler = client.describe_take_over_type_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;

```



---

### getTakeOverTypeModel

引き継ぎ情報タイプモデルを取得<br>

指定されたネームスペースで指定されたタイプの、現在有効な引き継ぎ情報タイプモデルを取得します。<br>
タイプモデルには、この引き継ぎタイプに関連付けられた ID プロバイダーの OpenID Connect 設定やその他の設定が含まれます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOverTypeModel](#takeovertypemodel) | 引き継ぎ情報タイプモデル |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetTakeOverTypeModel(
    &account.GetTakeOverTypeModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverTypeModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getTakeOverTypeModel(
        (new GetTakeOverTypeModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverTypeModelRequest;
import io.gs2.account.result.GetTakeOverTypeModelResult;

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

try {
    GetTakeOverTypeModelResult result = client.getTakeOverTypeModel(
        new GetTakeOverTypeModelRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    TakeOverTypeModel 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetTakeOverTypeModelResult> asyncResult = null;
yield return client.GetTakeOverTypeModel(
    new Gs2.Gs2Account.Request.GetTakeOverTypeModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getTakeOverTypeModel(
        new Gs2Account.GetTakeOverTypeModelRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_take_over_type_model(
        account.GetTakeOverTypeModelRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_take_over_type_model({
    namespaceName="namespace-0001",
    type=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('account')

api_result_handler = client.get_take_over_type_model_async({
    namespaceName="namespace-0001",
    type=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;

```



---

### exportMaster

引き継ぎ情報タイプモデルマスターを有効化可能なマスターデータ形式でエクスポート<br>

現在の引き継ぎ情報タイプモデルマスターデータを有効化に使用できる形式でエクスポートします。<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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.exportMaster(
        new Gs2Account.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.export_master(
        account.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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>

指定されたネームスペースで現在有効化（公開）されている引き継ぎ情報タイプモデルのマスターデータを取得します。<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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetCurrentModelMaster(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetCurrentModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetCurrentModelMasterRequest;
import io.gs2.account.result.GetCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
    new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getCurrentModelMaster(
        new Gs2Account.GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_current_model_master(
        account.GetCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

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('account')

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. UpdateCurrentModelMaster を preUpload モードで、アップロードに使用したトークンを渡して実行し、マスターデータを反映します。


#### 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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentModelMaster(
    &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\PreUpdateCurrentModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.PreUpdateCurrentModelMasterRequest;
import io.gs2.account.result.PreUpdateCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.PreUpdateCurrentModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentModelMaster(
    new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.preUpdateCurrentModelMaster(
        new Gs2Account.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 account

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

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

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('account')

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>

指定されたネームスペースの引き継ぎ情報タイプモデルのマスターデータを更新し有効化（公開）します。<br>
2つのモードをサポートしています：インラインのマスターデータ用の 'direct' モードと、事前にアップロードされたマスターデータ用の 'preUpload' モードです。<br>
1MBを超えるマスターデータの場合は、3フェーズの更新フロー（PreUpdate -> アップロード -> Update（preUpload モード））を使用してください。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| mode | 文字列列挙型<br>enum {<br>"direct",<br>"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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMaster(
    &account.UpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}"),
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateCurrentModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMaster(
        (new UpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateCurrentModelMasterRequest;
import io.gs2.account.result.UpdateCurrentModelMasterResult;

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

try {
    UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
        new UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
            .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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
    new Gs2.Gs2Account.Request.UpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateCurrentModelMaster(
        new Gs2Account.UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.update_current_model_master(
        account.UpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-07-30", "takeOverTypeModels": [{"type": 0, "metadata": "Google", "openIdConnectSetting": {"configurationPath": "https://accounts.google.com/.well-known/openid-configuration", "clientId": "695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com", "clientSecret": "secret"}}, {"type": 1, "metadata": "Apple", "openIdConnectSetting": {"configurationPath": "https://appleid.apple.com/.well-known/openid-configuration", "clientId": "io.gs2.sample.auth", "appleTeamId": "9LX9LA85H8", "appleKeyId": "P937MLY6Z7", "applePrivateKeyPem": "-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----"}}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.update_current_model_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}",
    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('account')

api_result_handler = client.update_current_model_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}",
    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 リポジトリから直接マスターデータを取得して更新・有効化（公開）します。<br>
チェックアウト設定には、使用するリポジトリ、ブランチ/タグ、ファイルパスを指定します。<br>
マスターデータをバージョン管理で管理し、直接デプロイする場合に便利です。


#### 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/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMasterFromGitHub(
    &account.UpdateCurrentModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &account.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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateCurrentModelMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.account.result.UpdateCurrentModelMasterFromGitHubResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
    new Gs2.Gs2Account.Request.UpdateCurrentModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateCurrentModelMasterFromGitHub(
        new Gs2Account.UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Account.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 account

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

try:
    result = client.update_current_model_master_from_git_hub(
        account.UpdateCurrentModelMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(account.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('account')

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('account')

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;

```



---

### describeTakeOverTypeModelMasters

引き継ぎ情報タイプモデルマスターの一覧を取得<br>

指定されたネームスペースの引き継ぎ情報タイプモデルマスターのページネーション付きリストを取得します。<br>
引き継ぎ情報タイプモデルマスターは、利用可能なアカウント引き継ぎ方法の種類を定義する引き継ぎ情報タイプモデルの編集可能なバージョンです。<br>
マスターデータへの変更は、現在のモデルマスターを通じて有効化（公開）されるまで反映されません。


#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;TakeOverTypeModelMaster&gt;](#takeovertypemodelmaster) | 引き継ぎ情報タイプモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeTakeOverTypeModelMasters(
    &account.DescribeTakeOverTypeModelMastersRequest {
        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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOverTypeModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeTakeOverTypeModelMasters(
        (new DescribeTakeOverTypeModelMastersRequest())
            ->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOverTypeModelMastersRequest;
import io.gs2.account.result.DescribeTakeOverTypeModelMastersResult;

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

try {
    DescribeTakeOverTypeModelMastersResult result = client.describeTakeOverTypeModelMasters(
        new DescribeTakeOverTypeModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<TakeOverTypeModelMaster> 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOverTypeModelMastersResult> asyncResult = null;
yield return client.DescribeTakeOverTypeModelMasters(
    new Gs2.Gs2Account.Request.DescribeTakeOverTypeModelMastersRequest()
        .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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.describeTakeOverTypeModelMasters(
        new Gs2Account.DescribeTakeOverTypeModelMastersRequest()
            .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 account

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

try:
    result = client.describe_take_over_type_model_masters(
        account.DescribeTakeOverTypeModelMastersRequest()
            .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('account')

api_result = client.describe_take_over_type_model_masters({
    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('account')

api_result_handler = client.describe_take_over_type_model_masters_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;

```



---

### createTakeOverTypeModelMaster

引き継ぎ情報タイプモデルマスターを新規作成<br>

アカウント引き継ぎ方法の種類を定義する新しい引き継ぎ情報タイプモデルマスターを作成します。<br>
タイプスロット（数値）、説明、メタデータ、ID プロバイダーの OpenID Connect 設定を構成できます。<br>
OpenID Connect 設定には、ID プロバイダー連携に必要なクライアントID、クライアントシークレット、イシュアー、その他の OIDC 設定が含まれます。<br>
変更は、現在のモデルマスターを通じて有効化（公開）されるまで反映されません。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 2048文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| openIdConnectSetting | [OpenIdConnectSetting](#openidconnectsetting) |  | ✓|  |  | OpenID Connect の設定<br>OpenID Connect 準拠の Identity Provider (IdP) と連携するための設定です。ディスカバリURL、クライアント認証情報、Apple Sign In パラメータなどのプラットフォーム固有の設定が含まれます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOverTypeModelMaster](#takeovertypemodelmaster) | 作成した引き継ぎ情報タイプモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateTakeOverTypeModelMaster(
    &account.CreateTakeOverTypeModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: pointy.Int32(0),
        Description: nil,
        Metadata: pointy.String("Google"),
        OpenIdConnectSetting: &account.OpenIdConnectSetting{
            ConfigurationPath: pointy.String("https://accounts.google.com/.well-known/openid-configuration"),
            ClientId: pointy.String("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com"),
            ClientSecret: pointy.String("secret"),
        },
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverTypeModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createTakeOverTypeModelMaster(
        (new CreateTakeOverTypeModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(0)
            ->withDescription(null)
            ->withMetadata("Google")
            ->withOpenIdConnectSetting((new \Gs2\Account\Model\OpenIdConnectSetting())
                ->withConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
                ->withClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
                ->withClientSecret("secret"))
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverTypeModelMasterRequest;
import io.gs2.account.result.CreateTakeOverTypeModelMasterResult;

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

try {
    CreateTakeOverTypeModelMasterResult result = client.createTakeOverTypeModelMaster(
        new CreateTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withDescription(null)
            .withMetadata("Google")
            .withOpenIdConnectSetting(new io.gs2.account.model.OpenIdConnectSetting()
                .withConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
                .withClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
                .withClientSecret("secret"))
    );
    TakeOverTypeModelMaster 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.CreateTakeOverTypeModelMaster(
    new Gs2.Gs2Account.Request.CreateTakeOverTypeModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(0)
        .WithDescription(null)
        .WithMetadata("Google")
        .WithOpenIdConnectSetting(new Gs2.Gs2Account.Model.OpenIdConnectSetting()
            .WithConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
            .WithClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
            .WithClientSecret("secret")),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.createTakeOverTypeModelMaster(
        new Gs2Account.CreateTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withDescription(null)
            .withMetadata("Google")
            .withOpenIdConnectSetting(new Gs2Account.model.OpenIdConnectSetting()
                .withConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
                .withClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
                .withClientSecret("secret"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.create_take_over_type_model_master(
        account.CreateTakeOverTypeModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
            .with_description(None)
            .with_metadata('Google')
            .with_open_id_connect_setting(
                account.OpenIdConnectSetting()
                    .with_configuration_path('https://accounts.google.com/.well-known/openid-configuration')
                    .with_client_id('695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com')
                    .with_client_secret('secret'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.create_take_over_type_model_master({
    namespaceName="namespace-0001",
    type=0,
    description=nil,
    metadata="Google",
    openIdConnectSetting={
        configurationPath="https://accounts.google.com/.well-known/openid-configuration",
        clientId="695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
        clientSecret="secret",
    },
})

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('account')

api_result_handler = client.create_take_over_type_model_master_async({
    namespaceName="namespace-0001",
    type=0,
    description=nil,
    metadata="Google",
    openIdConnectSetting={
        configurationPath="https://accounts.google.com/.well-known/openid-configuration",
        clientId="695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
        clientSecret="secret",
    },
})

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;

```



---

### getTakeOverTypeModelMaster

引き継ぎ情報タイプモデルマスターを取得<br>

指定されたネームスペースのタイプを指定して、特定の引き継ぎ情報タイプモデルマスターを取得します。<br>
取得される情報には、タイプスロット、説明、メタデータ、OpenID Connect 設定が含まれます。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOverTypeModelMaster](#takeovertypemodelmaster) | 引き継ぎ情報タイプモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetTakeOverTypeModelMaster(
    &account.GetTakeOverTypeModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverTypeModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getTakeOverTypeModelMaster(
        (new GetTakeOverTypeModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverTypeModelMasterRequest;
import io.gs2.account.result.GetTakeOverTypeModelMasterResult;

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

try {
    GetTakeOverTypeModelMasterResult result = client.getTakeOverTypeModelMaster(
        new GetTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    TakeOverTypeModelMaster 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.GetTakeOverTypeModelMaster(
    new Gs2.Gs2Account.Request.GetTakeOverTypeModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.getTakeOverTypeModelMaster(
        new Gs2Account.GetTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.get_take_over_type_model_master(
        account.GetTakeOverTypeModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.get_take_over_type_model_master({
    namespaceName="namespace-0001",
    type=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('account')

api_result_handler = client.get_take_over_type_model_master_async({
    namespaceName="namespace-0001",
    type=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;

```



---

### updateTakeOverTypeModelMaster

引き継ぎ情報タイプモデルマスターデータを更新<br>

指定された引き継ぎ情報タイプモデルマスターを更新します。<br>
説明、メタデータ、ID プロバイダーの OpenID Connect 設定を変更できます。<br>
変更は、現在のモデルマスターを通じて有効化（公開）されるまで反映されません。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 2048文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| openIdConnectSetting | [OpenIdConnectSetting](#openidconnectsetting) |  | ✓|  |  | OpenID Connect の設定<br>OpenID Connect 準拠の Identity Provider (IdP) と連携するための設定です。ディスカバリURL、クライアント認証情報、Apple Sign In パラメータなどのプラットフォーム固有の設定が含まれます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOverTypeModelMaster](#takeovertypemodelmaster) | 更新した引き継ぎ情報タイプモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateTakeOverTypeModelMaster(
    &account.UpdateTakeOverTypeModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: pointy.Int32(0),
        Description: pointy.String("description1"),
        Metadata: pointy.String("Microsoft"),
        OpenIdConnectSetting: &account.OpenIdConnectSetting{
            ConfigurationPath: pointy.String("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration"),
            ClientId: pointy.String("io.gs2.sample.auth"),
            ClientSecret: pointy.String("secret"),
        },
    }
)
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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverTypeModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateTakeOverTypeModelMaster(
        (new UpdateTakeOverTypeModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(0)
            ->withDescription("description1")
            ->withMetadata("Microsoft")
            ->withOpenIdConnectSetting((new \Gs2\Account\Model\OpenIdConnectSetting())
                ->withConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
                ->withClientId("io.gs2.sample.auth")
                ->withClientSecret("secret"))
    );
    $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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverTypeModelMasterRequest;
import io.gs2.account.result.UpdateTakeOverTypeModelMasterResult;

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

try {
    UpdateTakeOverTypeModelMasterResult result = client.updateTakeOverTypeModelMaster(
        new UpdateTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withDescription("description1")
            .withMetadata("Microsoft")
            .withOpenIdConnectSetting(new io.gs2.account.model.OpenIdConnectSetting()
                .withConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
                .withClientId("io.gs2.sample.auth")
                .withClientSecret("secret"))
    );
    TakeOverTypeModelMaster 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.UpdateTakeOverTypeModelMaster(
    new Gs2.Gs2Account.Request.UpdateTakeOverTypeModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(0)
        .WithDescription("description1")
        .WithMetadata("Microsoft")
        .WithOpenIdConnectSetting(new Gs2.Gs2Account.Model.OpenIdConnectSetting()
            .WithConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
            .WithClientId("io.gs2.sample.auth")
            .WithClientSecret("secret")),
    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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.updateTakeOverTypeModelMaster(
        new Gs2Account.UpdateTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
            .withDescription("description1")
            .withMetadata("Microsoft")
            .withOpenIdConnectSetting(new Gs2Account.model.OpenIdConnectSetting()
                .withConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
                .withClientId("io.gs2.sample.auth")
                .withClientSecret("secret"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.update_take_over_type_model_master(
        account.UpdateTakeOverTypeModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
            .with_description('description1')
            .with_metadata('Microsoft')
            .with_open_id_connect_setting(
                account.OpenIdConnectSetting()
                    .with_configuration_path('https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration')
                    .with_client_id('io.gs2.sample.auth')
                    .with_client_secret('secret'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.update_take_over_type_model_master({
    namespaceName="namespace-0001",
    type=0,
    description="description1",
    metadata="Microsoft",
    openIdConnectSetting={
        configurationPath="https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration",
        clientId="io.gs2.sample.auth",
        clientSecret="secret",
    },
})

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('account')

api_result_handler = client.update_take_over_type_model_master_async({
    namespaceName="namespace-0001",
    type=0,
    description="description1",
    metadata="Microsoft",
    openIdConnectSetting={
        configurationPath="https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration",
        clientId="io.gs2.sample.auth",
        clientSecret="secret",
    },
})

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;

```



---

### deleteTakeOverTypeModelMaster

引き継ぎ情報タイプモデルマスターデータを削除<br>

指定されたネームスペースから指定された引き継ぎ情報タイプモデルマスターを削除します。<br>
削除後、次回のマスターデータ有効化以降、この引き継ぎタイプは利用できなくなります。<br>
この操作はマスターデータにのみ影響し、マスターデータが再有効化されるまで現在有効なモデルは変更されません。


#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| type | int |  | ✓|  | 0 ~ 1024 | スロット番号<br>0から1024までの範囲で指定され、異なる引き継ぎ情報を区別します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [TakeOverTypeModelMaster](#takeovertypemodelmaster) | 削除した引き継ぎ情報タイプモデルマスターデータ |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteTakeOverTypeModelMaster(
    &account.DeleteTakeOverTypeModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Type: 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\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverTypeModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTakeOverTypeModelMaster(
        (new DeleteTakeOverTypeModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withType(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverTypeModelMasterRequest;
import io.gs2.account.result.DeleteTakeOverTypeModelMasterResult;

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

try {
    DeleteTakeOverTypeModelMasterResult result = client.deleteTakeOverTypeModelMaster(
        new DeleteTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    TakeOverTypeModelMaster 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 Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.DeleteTakeOverTypeModelMaster(
    new Gs2.Gs2Account.Request.DeleteTakeOverTypeModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithType(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 Gs2Account from '@/gs2/account';

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

try {
    const result = await client.deleteTakeOverTypeModelMaster(
        new Gs2Account.DeleteTakeOverTypeModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import account

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

try:
    result = client.delete_take_over_type_model_master(
        account.DeleteTakeOverTypeModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('account')

api_result = client.delete_take_over_type_model_master({
    namespaceName="namespace-0001",
    type=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('account')

api_result_handler = client.delete_take_over_type_model_master_async({
    namespaceName="namespace-0001",
    type=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;

```



---



