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

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

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



## モデル

### Namespace

ネームスペース<br>

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

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



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024文字 | ネームスペースGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | ✓ |  |  | トランザクション設定<br>ランキング報酬の付与に使用される分散トランザクションの設定です。入手アクションを自動実行するオートラン、全体の成否を保証するアトミックコミットをサポートします。 |
| logSetting | [LogSetting](#logsetting) |  |  |  |  | ログの出力設定<br>APIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。スコア登録やランキング報酬配布の追跡に使用されます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

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




---

### TransactionSetting

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

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



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

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


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




---

### LogSetting

ログの出力設定<br>

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



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

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


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




---

### GitHubCheckoutSetting

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



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

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




---

### GlobalRankingScore

グローバルランキングスコア<br>

特定シーズンのグローバルランキングにおけるユーザーの登録スコアを保存します。合算モードが有効な場合、複数の登録スコアが累積されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| globalRankingScoreId | string |  | ※ |  |  ~ 1024文字 | グローバルランキングスコアGRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。新しいランキング期間ごとに増加します。 |
| score | long |  | ✓ |  | 0 ~ 9223372036854775805 | スコア<br>ユーザーが登録したスコア値です。ランキングモデルの minimumValue と maximumValue で定義された範囲内である必要があります。 |
| metadata | string |  |  |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeGlobalRankingScores - グローバルランキングスコアの一覧を取得
describeGlobalRankingScoresByUserId - ユーザーIDを指定してグローバルランキングスコアの一覧を取得
putGlobalRankingScore - グローバルランキングスコアを登録
putGlobalRankingScoreByUserId - ユーザーIDを指定してグローバルランキングスコアを登録
getGlobalRankingScore - グローバルランキングスコアを取得
getGlobalRankingScoreByUserId - ユーザーIDを指定してグローバルランキングスコアを取得
deleteGlobalRankingScoreByUserId - ユーザーIDを指定してグローバルランキングスコアを削除
verifyGlobalRankingScore - グローバルランキングのスコアを検証
verifyGlobalRankingScoreByUserId - ユーザーIDを指定してグローバルランキングのスコアを検証




---

### GlobalRankingReceivedReward

グローバルランキング報酬受け取り履歴<br>

グローバルランキングでの順位に対して報酬を設定できます。<br>
報酬を設定するには 順位閾値 と 報酬の内容 を設定します。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| globalRankingReceivedRewardId | string |  | ※ |  |  ~ 1024文字 | グローバルランキング報酬受け取り履歴GRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。新しいランキング期間ごとに増加します。 |
| receivedAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeGlobalRankingReceivedRewards - グローバルランキング報酬受け取り履歴の一覧を取得
describeGlobalRankingReceivedRewardsByUserId - ユーザーIDを指定してグローバルランキング報酬受け取り履歴の一覧を取得
createGlobalRankingReceivedReward - グローバルランキング報酬受け取り履歴を記録
createGlobalRankingReceivedRewardByUserId - ユーザーIDを指定してグローバルランキング報酬受け取り履歴を記録
getGlobalRankingReceivedReward - グローバルランキング報酬受け取り履歴を取得
getGlobalRankingReceivedRewardByUserId - ユーザーIDを指定してグローバルランキング報酬受け取り履歴を取得
deleteGlobalRankingReceivedRewardByUserId - ユーザーIDを指定してグローバルランキング報酬受け取り履歴を削除




---

### GlobalRankingData

グローバルランキング<br>

特定シーズンのグローバルランキングにおけるランキングエントリを表します。ユーザーのスコア、0始まりのインデックス（ソート位置）、1始まりの順位（同点を考慮）を含みます。順位はインデックス + 1 で計算されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| globalRankingDataId | string |  | ※ |  |  ~ 1024文字 | グローバルランキングGRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。新しいランキング期間ごとに増加します。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| index | int |  |  |  | 0 ~ 2147483646 | インデックス<br>ランキング内のこのエントリの0始まりの一意のソート位置です。順位とは異なり、スコアが同点でもインデックスは常に一意です。インデックスベースの報酬計算に使用されます。 |
| rank | int |  |  |  | 0 ~ 2147483646 | 順位<br>1始まりのランキング順位です。同スコアのプレイヤーは同じ順位を共有します。インデックス + 1 で計算されます。順位ベースの報酬計算に使用されます。 |
| score | long |  | ✓ |  | 0 ~ 9223372036854775805 | スコア |
| metadata | string |  |  |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| invertUpdatedAt | long |  | ✓ |  | 0 ~ 9223372036854775805 | 更新日時の反転値（ソート用の内部値） |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeGlobalRankings - グローバルランキングの一覧を取得
describeGlobalRankingsByUserId - ユーザーIDを指定してグローバルランキングの一覧を取得
getGlobalRanking - グローバルランキングを取得
getGlobalRankingByUserId - ユーザーIDを指定してグローバルランキングを取得




---

### ClusterRankingScore

クラスターランキングスコア<br>

特定シーズン・クラスターにおけるユーザーの登録スコアを保存します。スコアの受付前に、クラスタータイプ設定に基づいてユーザーのクラスター所属が検証されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| clusterRankingScoreId | string |  | ※ |  |  ~ 1024文字 | クラスターランキングスコアGRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓ |  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| score | long |  | ✓ |  | 0 ~ 9223372036854775805 | スコア<br>このクラスター内でユーザーが登録したスコア値です。 |
| metadata | string |  |  |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeClusterRankingScores - クラスターランキングスコアの一覧を取得
describeClusterRankingScoresByUserId - ユーザーIDを指定してクラスターランキングスコアの一覧を取得
putClusterRankingScore - クラスターランキングスコアを登録
putClusterRankingScoreByUserId - ユーザーIDを指定してクラスターランキングスコアを登録
getClusterRankingScore - クラスターランキングスコアを取得
getClusterRankingScoreByUserId - ユーザーIDを指定してクラスターランキングスコアを取得
deleteClusterRankingScoreByUserId - ユーザーIDを指定してクラスターランキングスコアを削除
verifyClusterRankingScore - クラスターランキングのスコアを検証
verifyClusterRankingScoreByUserId - ユーザーIDを指定してクラスターランキングのスコアを検証




---

### ClusterRankingReceivedReward

クラスターランキング報酬受け取り履歴<br>

クラスターランキングの順位に応じた報酬を設定できます。<br>
報酬を設定するには 順位閾値 と 報酬の内容 を設定します。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| clusterRankingReceivedRewardId | string |  | ※ |  |  ~ 1024文字 | クラスターランキング報酬受け取り履歴GRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓ |  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| receivedAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeClusterRankingReceivedRewards - クラスターランキング報酬受け取り履歴の一覧を取得
describeClusterRankingReceivedRewardsByUserId - ユーザーIDを指定してクラスターランキング報酬受け取り履歴の一覧を取得
createClusterRankingReceivedReward - クラスターランキング報酬受け取り履歴を記録
createClusterRankingReceivedRewardByUserId - ユーザーIDを指定してクラスターランキング報酬受け取り履歴を記録
getClusterRankingReceivedReward - クラスターランキング報酬受け取り履歴を取得
getClusterRankingReceivedRewardByUserId - ユーザーIDを指定してクラスターランキング報酬受け取り履歴を取得
deleteClusterRankingReceivedRewardByUserId - ユーザーIDを指定してクラスターランキング報酬受け取り履歴を削除




---

### ClusterRankingData

クラスターランキング<br>

特定シーズン・クラスターにおけるクラスターランキングのランキングエントリを表します。クラスター内のユーザーのスコア、0始まりのインデックス、1始まりの順位を含みます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| clusterRankingDataId | string |  | ※ |  |  ~ 1024文字 | クラスターランキングGRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓ |  |  ~ 1024文字 | クラスター名<br>このシーズンが属するクラスター（ギルド、ギャザリング、またはグループ）の名前です。 |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| index | int |  |  |  | 0 ~ 2147483646 | インデックス<br>クラスターランキング内の0始まりの一意のソート位置です。スコアが同点でも常に一意です。 |
| rank | int |  |  |  | 0 ~ 2147483646 | 順位<br>クラスター内の1始まりのランキング順位です。同スコアのプレイヤーは同じ順位を共有します。インデックス + 1 で計算されます。 |
| score | long |  | ✓ |  | 0 ~ 9223372036854775805 | スコア |
| metadata | string |  |  |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| invertUpdatedAt | long |  | ✓ |  | 0 ~ 9223372036854775805 | 更新日時の反転値（ソート用の内部値） |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeClusterRankings - クラスターランキングの一覧を取得
describeClusterRankingsByUserId - ユーザーIDを指定してクラスターランキングの一覧を取得
getClusterRanking - クラスターランキングを取得
getClusterRankingByUserId - ユーザーIDを指定してクラスターランキングを取得




---

### Subscribe

購読<br>

他プレイヤーを購読対象として登録することで、そのプレイヤーの最新スコアを自身のランキングボードに反映できます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| subscribeId | string |  | ※ |  |  ~ 1024文字 | スコア購読GRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| targetUserIds | List&lt;string&gt; |  |  | [] | 0 ~ 1000 items | 購読対象ユーザーID<br>このユーザーが購読しているユーザーIDのリストです。購読対象ユーザーのスコアがこのユーザーの購読ランキングに表示されます。最大1000ユーザーまで購読可能で、重複購読は防止されます。 |
| fromUserIds | List&lt;string&gt; |  |  | [] | 0 ~ 1000 items | 被購読対象ユーザーID<br>このユーザーを購読しているユーザーIDのリストです。targetUserIds の逆方向の関係で、どのユーザーがこのユーザーのスコアをフォローしているかを追跡します。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |



---

### SubscribeRankingScore

購読ランキングスコア<br>

特定シーズンの購読ランキングにおけるユーザーの登録スコアを保存します。このスコアは、このユーザーを購読しているユーザーに表示され、パーソナライズされたフレンドランキングを形成します。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| subscribeRankingScoreId | string |  | ※ |  |  ~ 1024文字 | 購読ランキングスコアGRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| score | long |  | ✓ |  | 0 ~ 9223372036854775805 | スコア |
| metadata | string |  |  |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeSubscribeRankingScores - 購読ランキングスコアの一覧を取得
describeSubscribeRankingScoresByUserId - ユーザーIDを指定して購読ランキングスコアの一覧を取得
putSubscribeRankingScore - 購読ランキングスコアを登録
putSubscribeRankingScoreByUserId - ユーザーIDを指定して購読ランキングスコアを登録
getSubscribeRankingScore - 購読ランキングスコアを取得
getSubscribeRankingScoreByUserId - ユーザーIDを指定して購読ランキングスコアを取得
deleteSubscribeRankingScoreByUserId - ユーザーIDを指定して購読ランキングスコアを削除
verifySubscribeRankingScore - 購読ランキングのスコアを検証
verifySubscribeRankingScoreByUserId - ユーザーIDを指定して購読ランキングのスコアを検証




---

### SubscribeRankingData

購読ランキング<br>

特定シーズンのユーザーのパーソナライズされた購読ランキングにおけるランキングエントリを表します。購読ユーザーのスコアを含み、フレンドリスト内でランク付けされます。各エントリにはスコアを達成したユーザーIDが含まれます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| subscribeRankingDataId | string |  | ※ |  |  ~ 1024文字 | 購読ランキングGRN<br>※ サーバーが自動で設定 |
| rankingName | string |  | ✓ |  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| season | long |  | ✓ |  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| index | int |  |  |  | 0 ~ 2147483646 | インデックス<br>購読ランキング内の0始まりの一意のソート位置です。 |
| rank | int |  |  |  | 0 ~ 2147483646 | 順位<br>購読ランキング内の1始まりのランキング順位です。インデックス + 1 で計算されます。 |
| scorerUserId | string |  | ✓ |  |  ~ 128文字 | スコアを獲得したユーザーID<br>このスコアを達成したプレイヤーのユーザーIDです。購読ランキングでは購読ユーザーのスコアがエントリとなるため、このフィールドはどのフレンドのスコアかを識別します。 |
| score | long |  | ✓ |  | 0 ~ 9223372036854775805 | スコア |
| metadata | string |  |  |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| invertUpdatedAt | long |  | ✓ |  | 0 ~ 9223372036854775805 | 更新日時の反転値（ソート用の内部値） |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeSubscribeRankings - 購読ランキングの一覧を取得
describeSubscribeRankingsByUserId - ユーザーIDを指定して購読ランキングの一覧を取得
getSubscribeRanking - 購読ランキングを取得
getSubscribeRankingByUserId - ユーザーIDを指定して購読ランキングを取得




---

### SubscribeUser

購読対象ユーザー情報<br>

購読ランキングにおける2ユーザー間の購読関係を表します。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| rankingName | string |  | ✓ |  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| targetUserId | string |  | ✓ |  |  ~ 128文字 | 購読対象ユーザーID<br>購読対象のプレイヤーのユーザーIDです。このプレイヤーのスコアが購読者のパーソナライズされたランキングに含まれます。 |

**関連するメソッド:**
describeSubscribes - 購読対象ユーザー情報の一覧を取得
describeSubscribesByUserId - ユーザーIDを指定して購読対象ユーザー情報の一覧を取得
addSubscribe - 購読対象のユーザーIDを登録
addSubscribeByUserId - ユーザーIDを指定して購読対象のユーザーIDを登録
getSubscribe - 購読対象ユーザー情報を取得
getSubscribeByUserId - ユーザーIDを指定して購読対象ユーザー情報を取得
deleteSubscribe - 購読対象のユーザーIDを削除
deleteSubscribeByUserId - ユーザーIDを指定して購読対象のユーザーIDを削除




---

### GlobalRankingModel

グローバルランキングモデル<br>

グローバルランキングは全てのプレイヤーを対象としたランキングを実現するためのモデルです。<br>
上位1000位までのランキングを表示することができます。<br>

GS2-Schedule の繰り返しイベントと関連づけると、繰り返し回数に応じてランキングをリセットすることができます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| globalRankingModelId | string |  | ※ |  |  ~ 1024文字 | グローバルランキングGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。無効または意図しないスコア値のフィルタリングに使用します。 |
| maximumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。異常に高いスコアの登録防止に使用します。 |
| sum | bool |  |  | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、ソート方向に応じた最良のスコア（最高値または最低値）のみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓ |  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合（例：タイムアタック）は「昇順」、高いスコアほど上位の場合（例：ハイスコア）は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  |  |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、繰り返しサイクルごとにランキングがリセットされ、シーズン制ランキングを実現できます。 |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null |  | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。各報酬は順位閾値と実行する入手アクションを定義します。 |
| accessPeriodEventId | string |  |  |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。通常、スコア登録期間の間のインターバルに設定します。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  |  | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位を使用し（同スコアのプレイヤーは同じ順位を共有）、「インデックスベース」は0始まりの一意のソート位置を使用します（同順位なし）。通常のユースケースでは「順位ベース」を選択してください。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |

**関連するメソッド:**
receiveGlobalRankingReceivedReward - グローバルランキング報酬受け取り
receiveGlobalRankingReceivedRewardByUserId - ユーザーIDを指定してグローバルランキング報酬受け取り
describeGlobalRankingModels - グローバルランキングモデルの一覧を取得
getGlobalRankingModel - グローバルランキングモデルを取得




---

### ClusterRankingModel

クラスターランキングモデル<br>

クラスターランキングはギルドやギャザリング内のプレイヤーを対象としたランキングを実現するためのモデルです。<br>
上位1000位までのランキングを表示することができます。<br>

GS2-Schedule の繰り返しイベントと関連づけると、繰り返し回数に応じてランキングをリセットすることができます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| clusterRankingModelId | string |  | ※ |  |  ~ 1024文字 | クラスターランキングGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| clusterType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"Raw",<br>&nbsp;&nbsp;"Gs2Guild::Guild",<br>&nbsp;&nbsp;"Gs2Matchmaking::SeasonGathering"<br>}<br> |  | ✓ |  |  | クラスタータイプ<br>ランキングのセグメンテーションに使用するグループ（クラスター）の種類を定義します。「Raw」は所属検証なしで任意のクラスター名を指定でき、「Gs2Guild::Guild」はGS2-Guildギルドへの所属を検証し、「Gs2Matchmaking::SeasonGathering」はGS2-Matchmakingシーズンギャザリングへの所属を検証します。"Raw": 検証なし / "Gs2Guild::Guild": GS2-Guild ギルド / "Gs2Matchmaking::SeasonGathering": GS2-Matchmaking シーズンギャザリング /  |
| minimumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  |  | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓ |  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  |  |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null |  | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。 |
| accessPeriodEventId | string |  |  |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  |  | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位（同スコアは同順位）、「インデックスベース」は0始まりの一意のソート位置（同順位なし）を使用します。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |

**関連するメソッド:**
receiveClusterRankingReceivedReward - クラスターランキング報酬受け取り
receiveClusterRankingReceivedRewardByUserId - ユーザーIDを指定してクラスターランキング報酬受け取り
describeClusterRankingModels - クラスターランキングモデルの一覧を取得
getClusterRankingModel - クラスターランキングモデルを取得




---

### SubscribeRankingModel

購読ランキングモデル<br>

購読した他プレイヤーのスコアを集計し、ランキングを作成するモデルです。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| subscribeRankingModelId | string |  | ※ |  |  ~ 1024文字 | 購読ランキングGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  |  | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓ |  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  |  |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  |  |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧が可能な期間を定義する GS2-Schedule のイベントGRNです。 |

**関連するメソッド:**
describeSubscribeRankingModels - 購読ランキングモデルの一覧を取得
getSubscribeRankingModel - 購読ランキングモデルを取得




---

### RankingReward

ランキング報酬<br>

スコアの登録期間が設定されたランキングで、登録期間外で参照期間内の時に受け取れる報酬を設定します。<br>
繰り返し設定が有効な場合、直近に期間を終えたランキングが報酬の受け取り対象となります。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| thresholdRank | int |  | ✓ |  | 1 ~ 1001 | 順位閾値<br>この報酬ティアの順位閾値です。順位（またはインデックス、rewardCalculationIndex の設定に依存）がこの閾値以上のプレイヤーがこの報酬を受け取ります。1001に設定すると、ランク外（上位1000位外）のプレイヤー向けの報酬を定義できます。 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| acquireActions | [List&lt;AcquireAction&gt;](#acquireaction) |  |  | [] | 0 ~ 100 items | 入手アクションリスト<br>プレイヤーがこのランキング報酬を受け取る際に実行される入手アクションのリストです。この順位閾値を達成した報酬として付与されるアイテム、通貨、その他のリソースを定義します。 |

**関連するモデル:**
GlobalRankingModel - グローバルランキングモデル
ClusterRankingModel - クラスターランキングモデル
GlobalRankingModelMaster - グローバルランキングモデルマスター
ClusterRankingModelMaster - クラスターランキングモデルマスター




---

### VerifyActionResult

検証アクションの実行結果



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| action | 文字列列挙型<br>enum {<br>}<br> |  | ✓ |  |  | 検証アクションで実行するアクションの種類 |
| verifyRequest | string |  | ✓ |  |  ~ 524288文字 | アクション実行時に使用されるリクエストのJSON文字列 |
| statusCode | int |  |  |  | 0 ~ 999 | ステータスコード |
| verifyResult | string |  |  |  |  ~ 1048576文字 | 結果内容 |

**関連するモデル:**
TransactionResult - トランザクション実行結果




---

### ConsumeActionResult

消費アクションの実行結果



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| action | 文字列列挙型<br>enum {<br>}<br> |  | ✓ |  |  | 消費アクションで実行するアクションの種類 |
| consumeRequest | string |  | ✓ |  |  ~ 524288文字 | アクション実行時に使用されるリクエストのJSON文字列 |
| statusCode | int |  |  |  | 0 ~ 999 | ステータスコード |
| consumeResult | string |  |  |  |  ~ 1048576文字 | 結果内容 |

**関連するモデル:**
TransactionResult - トランザクション実行結果




---

### AcquireActionResult

入手アクションの実行結果



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| action | 文字列列挙型<br>enum {<br>}<br> |  | ✓ |  |  | 入手アクションで実行するアクションの種類 |
| acquireRequest | string |  | ✓ |  |  ~ 524288文字 | アクション実行時に使用されるリクエストのJSON文字列 |
| statusCode | int |  |  |  | 0 ~ 999 | ステータスコード |
| acquireResult | string |  |  |  |  ~ 1048576文字 | 結果内容 |

**関連するモデル:**
TransactionResult - トランザクション実行結果




---

### TransactionResult

トランザクション実行結果<br>

サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| transactionId | string |  | ✓ |  | 36 ~ 36文字 | トランザクションID |
| verifyResults | [List&lt;VerifyActionResult&gt;](#verifyactionresult) |  |  |  | 0 ~ 10 items | 検証アクションの実行結果リスト |
| consumeResults | [List&lt;ConsumeActionResult&gt;](#consumeactionresult) |  |  | [] | 0 ~ 10 items | 消費アクションの実行結果リスト |
| acquireResults | [List&lt;AcquireActionResult&gt;](#acquireactionresult) |  |  | [] | 0 ~ 100 items | 入手アクションの実行結果リスト |
| hasError | bool |  |  | false |  | トランザクション実行中にエラーが発生したかどうか |

**関連するメソッド:**
receiveGlobalRankingReceivedReward - グローバルランキング報酬受け取り
receiveGlobalRankingReceivedRewardByUserId - ユーザーIDを指定してグローバルランキング報酬受け取り
receiveClusterRankingReceivedReward - クラスターランキング報酬受け取り
receiveClusterRankingReceivedRewardByUserId - ユーザーIDを指定してクラスターランキング報酬受け取り




---

### AcquireAction

入手アクション



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| action | 文字列列挙型<br>enum {<br>}<br> |  | ✓ |  |  | 入手アクションで実行するアクションの種類 |
| request | string |  | ✓ |  |  ~ 524288文字 | アクション実行時に使用されるリクエストのJSON文字列 |

**関連するメソッド:**
receiveGlobalRankingReceivedReward - グローバルランキング報酬受け取り
receiveGlobalRankingReceivedRewardByUserId - ユーザーIDを指定してグローバルランキング報酬受け取り
receiveClusterRankingReceivedReward - クラスターランキング報酬受け取り
receiveClusterRankingReceivedRewardByUserId - ユーザーIDを指定してクラスターランキング報酬受け取り


**関連するモデル:**
RankingReward - ランキング報酬




---

### Config

コンフィグ設定<br>

トランザクションの変数に適用する設定値



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| key | string |  | ✓ |  |  ~ 64文字 | 名前 |
| value | string |  |  |  |  ~ 51200文字 | 値 |



---

### CurrentRankingMaster

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

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

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



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

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




---

### GlobalRankingModelMaster

グローバルランキングモデルマスター<br>

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

グローバルランキングモデルは全てのプレイヤーを対象としたランキングを実現するためのモデルです。<br>
上位1000位までのランキングを表示することができます。<br>

GS2-Schedule の繰り返しイベントと関連づけると、繰り返し回数に応じてランキングをリセットすることができます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| globalRankingModelId | string |  | ※ |  |  ~ 1024文字 | グローバルランキングマスターGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。無効または意図しないスコア値のフィルタリングに使用します。 |
| maximumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。異常に高いスコアの登録防止に使用します。 |
| sum | bool |  |  | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、ソート方向に応じた最良のスコア（最高値または最低値）のみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓ |  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合（例：タイムアタック）は「昇順」、高いスコアほど上位の場合（例：ハイスコア）は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  |  |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、繰り返しサイクルごとにランキングがリセットされ、シーズン制ランキングを実現できます。 |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null |  | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。各報酬は順位閾値と実行する入手アクションを定義します。 |
| accessPeriodEventId | string |  |  |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。通常、スコア登録期間の間のインターバルに設定します。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  |  | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位を使用し（同スコアのプレイヤーは同じ順位を共有）、「インデックスベース」は0始まりの一意のソート位置を使用します（同順位なし）。通常のユースケースでは「順位ベース」を選択してください。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeGlobalRankingModelMasters - グローバルランキングモデルマスターの一覧を取得
createGlobalRankingModelMaster - グローバルランキングモデルマスターを新規作成
getGlobalRankingModelMaster - グローバルランキングモデルマスターを取得
updateGlobalRankingModelMaster - グローバルランキングモデルマスターを更新
deleteGlobalRankingModelMaster - グローバルランキングモデルマスターを削除




---

### ClusterRankingModelMaster

クラスターランキングモデルマスター<br>

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

クラスターランキングモデルはギルドやギャザリング内のプレイヤーを対象としたランキングを実現するためのモデルです。<br>
上位1000位までのランキングを表示することができます。<br>

GS2-Schedule の繰り返しイベントと関連づけると、繰り返し回数に応じてランキングをリセットすることができます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| clusterRankingModelId | string |  | ※ |  |  ~ 1024文字 | クラスターランキングマスターGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| clusterType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"Raw",<br>&nbsp;&nbsp;"Gs2Guild::Guild",<br>&nbsp;&nbsp;"Gs2Matchmaking::SeasonGathering"<br>}<br> |  | ✓ |  |  | クラスタータイプ<br>ランキングのセグメンテーションに使用するグループ（クラスター）の種類を定義します。「Raw」は所属検証なしで任意のクラスター名を指定でき、「Gs2Guild::Guild」はGS2-Guildギルドへの所属を検証し、「Gs2Matchmaking::SeasonGathering」はGS2-Matchmakingシーズンギャザリングへの所属を検証します。"Raw": 検証なし / "Gs2Guild::Guild": GS2-Guild ギルド / "Gs2Matchmaking::SeasonGathering": GS2-Matchmaking シーズンギャザリング /  |
| minimumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  |  | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓ |  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  |  |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null |  | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。 |
| accessPeriodEventId | string |  |  |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  |  | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位（同スコアは同順位）、「インデックスベース」は0始まりの一意のソート位置（同順位なし）を使用します。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeClusterRankingModelMasters - クラスターランキングモデルマスターの一覧を取得
createClusterRankingModelMaster - クラスターランキングモデルマスターを新規作成
getClusterRankingModelMaster - クラスターランキングモデルマスターを取得
updateClusterRankingModelMaster - クラスターランキングモデルマスターを更新
deleteClusterRankingModelMaster - クラスターランキングモデルマスターを削除




---

### SubscribeRankingModelMaster

購読ランキングモデルマスター<br>

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

購読ランキングモデルは、購読した他プレイヤーのスコアを集計し、ランキングを作成するモデルです。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| subscribeRankingModelId | string |  | ※ |  |  ~ 1024文字 | グローバルランキングマスターGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| metadata | string |  |  |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  |  |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  |  | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓ |  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  |  |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  |  |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧が可能な期間を定義する GS2-Schedule のイベントGRNです。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeSubscribeRankingModelMasters - 購読ランキングモデルマスターの一覧を取得
createSubscribeRankingModelMaster - 購読ランキングモデルマスターを新規作成
getSubscribeRankingModelMaster - 購読ランキングモデルマスターを取得
updateSubscribeRankingModelMaster - 購読ランキングモデルマスターを更新
deleteSubscribeRankingModelMaster - 購読ランキングモデルマスターを削除




---
## メソッド

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeNamespacesRequest;
import io.gs2.ranking2.result.DescribeNamespacesResult;

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

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

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

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

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

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

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

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) |  | ✓|  |  | トランザクション設定<br>ランキング報酬の付与に使用される分散トランザクションの設定です。入手アクションを自動実行するオートラン、全体の成否を保証するアトミックコミットをサポートします。 |
| logSetting | [LogSetting](#logsetting) |  | |  |  | ログの出力設定<br>APIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。スコア登録やランキング報酬配布の追跡に使用されます。 |

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &ranking2.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        LogSetting: &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\Ranking2\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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateNamespaceRequest;
import io.gs2.ranking2.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.ranking2.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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Ranking2.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createNamespace(
        new Gs2Ranking2.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new Gs2Ranking2.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 ranking2

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

try:
    result = client.create_namespace(
        ranking2.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_log_setting(
                ranking2.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('ranking2')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=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('ranking2')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

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

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

result = api_result.result
item = result.item;

```




---

### getNamespaceStatus

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

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



#### Request

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

#### Result

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

#### 実装例




**Go**
```go

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetNamespaceStatusRequest;
import io.gs2.ranking2.result.GetNamespaceStatusResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetNamespaceRequest;
import io.gs2.ranking2.result.GetNamespaceResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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) |  | ✓|  |  | トランザクション設定<br>ランキング報酬の付与に使用される分散トランザクションの設定です。入手アクションを自動実行するオートラン、全体の成否を保証するアトミックコミットをサポートします。 |
| logSetting | [LogSetting](#logsetting) |  | |  |  | ログの出力設定<br>APIリクエスト・レスポンスログの出力先となる GS2-Log のネームスペースを指定します。スコア登録やランキング報酬配布の追跡に使用されます。 |

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &ranking2.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        LogSetting: &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\Ranking2\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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateNamespaceRequest;
import io.gs2.ranking2.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.ranking2.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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Ranking2.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateNamespace(
        new Gs2Ranking2.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new Gs2Ranking2.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 ranking2

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

try:
    result = client.update_namespace(
        ranking2.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_log_setting(
                ranking2.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('ranking2')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=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('ranking2')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteNamespaceRequest;
import io.gs2.ranking2.result.DeleteNamespaceResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DumpUserDataByUserIdRequest;
import io.gs2.ranking2.result.DumpUserDataByUserIdResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.ranking2.result.CheckDumpUserDataByUserIdResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CleanUserDataByUserIdRequest;
import io.gs2.ranking2.result.CleanUserDataByUserIdResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.ranking2.result.CheckCleanUserDataByUserIdResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.ranking2.result.PrepareImportUserDataByUserIdResult;

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

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

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

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

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

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

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ImportUserDataByUserIdRequest;
import io.gs2.ranking2.result.ImportUserDataByUserIdResult;

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

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

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

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

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CheckImportUserDataByUserIdRequest;
import io.gs2.ranking2.result.CheckImportUserDataByUserIdResult;

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

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

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

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

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

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

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

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;

```




---

### describeGlobalRankingScores

グローバルランキングスコアの一覧を取得<br>

リクエストしたユーザーが登録したグローバルランキングスコアのページネーション付きリストを取得します。ランキング名でフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingScore&gt;](#globalrankingscore) | グローバルランキングスコアのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingScores(
    &ranking2.DescribeGlobalRankingScoresRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingScoresRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingScores(
        (new DescribeGlobalRankingScoresRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingScoresRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingScoresResult;

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

try {
    DescribeGlobalRankingScoresResult result = client.describeGlobalRankingScores(
        new DescribeGlobalRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingScoresResult> asyncResult = null;
yield return client.DescribeGlobalRankingScores(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingScoresRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingScores(
        new Gs2Ranking2.DescribeGlobalRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_global_ranking_scores(
        ranking2.DescribeGlobalRankingScoresRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_global_ranking_scores({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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('ranking2')

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

```




---

### describeGlobalRankingScoresByUserId

ユーザーIDを指定してグローバルランキングスコアの一覧を取得<br>

指定したユーザーが登録したグローバルランキングスコアのページネーション付きリストを取得します。ランキング名でフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingScore&gt;](#globalrankingscore) | グローバルランキングスコアのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingScoresByUserId(
    &ranking2.DescribeGlobalRankingScoresByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingScoresByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingScoresByUserId(
        (new DescribeGlobalRankingScoresByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingScoresByUserIdRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingScoresByUserIdResult;

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

try {
    DescribeGlobalRankingScoresByUserIdResult result = client.describeGlobalRankingScoresByUserId(
        new DescribeGlobalRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<GlobalRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingScoresByUserIdResult> asyncResult = null;
yield return client.DescribeGlobalRankingScoresByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingScoresByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingScoresByUserId(
        new Gs2Ranking2.DescribeGlobalRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_global_ranking_scores_by_user_id(
        ranking2.DescribeGlobalRankingScoresByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_global_ranking_scores_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### putGlobalRankingScore

グローバルランキングスコアを登録<br>

指定したグローバルランキングにスコアを登録します。スコアはランキングモデルで定義された範囲内である必要があります。エントリー期間イベントが設定されている場合、アクティブ期間中のみスコアを登録できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>ユーザーが登録したスコア値です。ランキングモデルの minimumValue と maximumValue で定義された範囲内である必要があります。 |
| metadata | string |  | |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingScore](#globalrankingscore) | 登録したグローバルランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutGlobalRankingScore(
    &ranking2.PutGlobalRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Score: pointy.Int64(100),
        Metadata: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutGlobalRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putGlobalRankingScore(
        (new PutGlobalRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withScore(100)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutGlobalRankingScoreRequest;
import io.gs2.ranking2.result.PutGlobalRankingScoreResult;

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

try {
    PutGlobalRankingScoreResult result = client.putGlobalRankingScore(
        new PutGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100L)
            .withMetadata(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutGlobalRankingScoreResult> asyncResult = null;
yield return client.PutGlobalRankingScore(
    new Gs2.Gs2Ranking2.Request.PutGlobalRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithScore(100L)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putGlobalRankingScore(
        new Gs2Ranking2.PutGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_global_ranking_score(
        ranking2.PutGlobalRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_score(100)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.put_global_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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('ranking2')

api_result_handler = client.put_global_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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;

```




---

### putGlobalRankingScoreByUserId

ユーザーIDを指定してグローバルランキングスコアを登録<br>

指定したユーザーに代わって、指定したグローバルランキングにスコアを登録します。スコアはランキングモデルで定義された範囲内である必要があります。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>ユーザーが登録したスコア値です。ランキングモデルの minimumValue と maximumValue で定義された範囲内である必要があります。 |
| metadata | string |  | |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingScore](#globalrankingscore) | 登録したグローバルランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutGlobalRankingScoreByUserId(
    &ranking2.PutGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Score: nil,
        Metadata: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putGlobalRankingScoreByUserId(
        (new PutGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withScore(null)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.PutGlobalRankingScoreByUserIdResult;

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

try {
    PutGlobalRankingScoreByUserIdResult result = client.putGlobalRankingScoreByUserId(
        new PutGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.PutGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.PutGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithScore(null)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putGlobalRankingScoreByUserId(
        new Gs2Ranking2.PutGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_global_ranking_score_by_user_id(
        ranking2.PutGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_score(None)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.put_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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('ranking2')

api_result_handler = client.put_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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;

```




---

### getGlobalRankingScore

グローバルランキングスコアを取得<br>

指定したランキングに対してリクエストしたユーザーが登録したグローバルランキングスコアを取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingScore](#globalrankingscore) | グローバルランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingScore(
    &ranking2.GetGlobalRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingScore(
        (new GetGlobalRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingScoreRequest;
import io.gs2.ranking2.result.GetGlobalRankingScoreResult;

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

try {
    GetGlobalRankingScoreResult result = client.getGlobalRankingScore(
        new GetGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingScoreResult> asyncResult = null;
yield return client.GetGlobalRankingScore(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingScore(
        new Gs2Ranking2.GetGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_score(
        ranking2.GetGlobalRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### getGlobalRankingScoreByUserId

ユーザーIDを指定してグローバルランキングスコアを取得<br>

指定したランキングに対して指定したユーザーが登録したグローバルランキングスコアを取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingScore](#globalrankingscore) | グローバルランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingScoreByUserId(
    &ranking2.GetGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingScoreByUserId(
        (new GetGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.GetGlobalRankingScoreByUserIdResult;

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

try {
    GetGlobalRankingScoreByUserIdResult result = client.getGlobalRankingScoreByUserId(
        new GetGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.GetGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingScoreByUserId(
        new Gs2Ranking2.GetGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_score_by_user_id(
        ranking2.GetGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### deleteGlobalRankingScoreByUserId

ユーザーIDを指定してグローバルランキングスコアを削除<br>

指定したユーザーが指定したランキングおよびシーズンに登録したグローバルランキングスコアを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingScore](#globalrankingscore) | 削除したグローバルランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteGlobalRankingScoreByUserId(
    &ranking2.DeleteGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteGlobalRankingScoreByUserId(
        (new DeleteGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.DeleteGlobalRankingScoreByUserIdResult;

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

try {
    DeleteGlobalRankingScoreByUserIdResult result = client.deleteGlobalRankingScoreByUserId(
        new DeleteGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.DeleteGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteGlobalRankingScoreByUserId(
        new Gs2Ranking2.DeleteGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_global_ranking_score_by_user_id(
        ranking2.DeleteGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### verifyGlobalRankingScore

グローバルランキングのスコアを検証<br>

グローバルランキングスコアを比較演算子（less, lessEqual, greater, greaterEqual, equal, notEqual）を使用して指定した値と比較検証します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| verifyType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"less",<br>&nbsp;&nbsp;"lessEqual",<br>&nbsp;&nbsp;"greater",<br>&nbsp;&nbsp;"greaterEqual",<br>&nbsp;&nbsp;"equal",<br>&nbsp;&nbsp;"notEqual"<br>}<br> |  | ✓|  |  | 検証の種類"less": スコアが指定値未満であること / "lessEqual": スコアが指定値以下であること / "greater": スコアが指定値超過であること / "greaterEqual": スコアが指定値以上であること / "equal": スコアが指定値と一致すること / "notEqual": スコアが指定値と一致しないこと /  |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>ユーザーが登録したスコア値です。ランキングモデルの minimumValue と maximumValue で定義された範囲内である必要があります。 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 数量指定した際に、検証に使用する値も乗算するか |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingScore](#globalrankingscore) | グローバルランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyGlobalRankingScore(
    &ranking2.VerifyGlobalRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyGlobalRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyGlobalRankingScore(
        (new VerifyGlobalRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyGlobalRankingScoreRequest;
import io.gs2.ranking2.result.VerifyGlobalRankingScoreResult;

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

try {
    VerifyGlobalRankingScoreResult result = client.verifyGlobalRankingScore(
        new VerifyGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyGlobalRankingScoreResult> asyncResult = null;
yield return client.VerifyGlobalRankingScore(
    new Gs2.Gs2Ranking2.Request.VerifyGlobalRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyGlobalRankingScore(
        new Gs2Ranking2.VerifyGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_global_ranking_score(
        ranking2.VerifyGlobalRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.verify_global_ranking_score({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_global_ranking_score_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

```




---

### verifyGlobalRankingScoreByUserId

ユーザーIDを指定してグローバルランキングのスコアを検証<br>

指定したユーザーのグローバルランキングスコアを比較演算子（less, lessEqual, greater, greaterEqual, equal, notEqual）を使用して指定した値と比較検証します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| verifyType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"less",<br>&nbsp;&nbsp;"lessEqual",<br>&nbsp;&nbsp;"greater",<br>&nbsp;&nbsp;"greaterEqual",<br>&nbsp;&nbsp;"equal",<br>&nbsp;&nbsp;"notEqual"<br>}<br> |  | ✓|  |  | 検証の種類"less": スコアが指定値未満であること / "lessEqual": スコアが指定値以下であること / "greater": スコアが指定値超過であること / "greaterEqual": スコアが指定値以上であること / "equal": スコアが指定値と一致すること / "notEqual": スコアが指定値と一致しないこと /  |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>ユーザーが登録したスコア値です。ランキングモデルの minimumValue と maximumValue で定義された範囲内である必要があります。 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 数量指定した際に、検証に使用する値も乗算するか |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingScore](#globalrankingscore) | グローバルランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyGlobalRankingScoreByUserId(
    &ranking2.VerifyGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyGlobalRankingScoreByUserId(
        (new VerifyGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.VerifyGlobalRankingScoreByUserIdResult;

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

try {
    VerifyGlobalRankingScoreByUserIdResult result = client.verifyGlobalRankingScoreByUserId(
        new VerifyGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.VerifyGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.VerifyGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyGlobalRankingScoreByUserId(
        new Gs2Ranking2.VerifyGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_global_ranking_score_by_user_id(
        ranking2.VerifyGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.verify_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

```




---

### describeGlobalRankingReceivedRewards

グローバルランキング報酬受け取り履歴の一覧を取得<br>

リクエストしたユーザーのグローバルランキング報酬受け取り履歴のページネーション付きリストを取得します。ランキング名とシーズンでフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingReceivedReward&gt;](#globalrankingreceivedreward) | グローバルランキング報酬受け取り履歴のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingReceivedRewards(
    &ranking2.DescribeGlobalRankingReceivedRewardsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: pointy.Int64(0),
        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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingReceivedRewardsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingReceivedRewards(
        (new DescribeGlobalRankingReceivedRewardsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(0)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingReceivedRewardsRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingReceivedRewardsResult;

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

try {
    DescribeGlobalRankingReceivedRewardsResult result = client.describeGlobalRankingReceivedRewards(
        new DescribeGlobalRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingReceivedRewardsResult> asyncResult = null;
yield return client.DescribeGlobalRankingReceivedRewards(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingReceivedRewardsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingReceivedRewards(
        new Gs2Ranking2.DescribeGlobalRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0)
            .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 ranking2

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

try:
    result = client.describe_global_ranking_received_rewards(
        ranking2.DescribeGlobalRankingReceivedRewardsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(0)
            .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('ranking2')

api_result = client.describe_global_ranking_received_rewards({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    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('ranking2')

api_result_handler = client.describe_global_ranking_received_rewards_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    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;

```




---

### describeGlobalRankingReceivedRewardsByUserId

ユーザーIDを指定してグローバルランキング報酬受け取り履歴の一覧を取得<br>

指定したユーザーのグローバルランキング報酬受け取り履歴のページネーション付きリストを取得します。ランキング名とシーズンでフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingReceivedReward&gt;](#globalrankingreceivedreward) | グローバルランキング報酬受け取り履歴のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingReceivedRewardsByUserId(
    &ranking2.DescribeGlobalRankingReceivedRewardsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingReceivedRewardsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingReceivedRewardsByUserId(
        (new DescribeGlobalRankingReceivedRewardsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingReceivedRewardsByUserIdRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingReceivedRewardsByUserIdResult;

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

try {
    DescribeGlobalRankingReceivedRewardsByUserIdResult result = client.describeGlobalRankingReceivedRewardsByUserId(
        new DescribeGlobalRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<GlobalRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingReceivedRewardsByUserIdResult> asyncResult = null;
yield return client.DescribeGlobalRankingReceivedRewardsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingReceivedRewardsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingReceivedRewardsByUserId(
        new Gs2Ranking2.DescribeGlobalRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_global_ranking_received_rewards_by_user_id(
        ranking2.DescribeGlobalRankingReceivedRewardsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_global_ranking_received_rewards_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### createGlobalRankingReceivedReward

グローバルランキング報酬受け取り履歴を記録<br>

指定したグローバルランキングの報酬受け取り履歴を記録します。実際に報酬を受け取る前にこの記録が必要です。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingReceivedReward](#globalrankingreceivedreward) | グローバルランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateGlobalRankingReceivedReward(
    &ranking2.CreateGlobalRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateGlobalRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createGlobalRankingReceivedReward(
        (new CreateGlobalRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateGlobalRankingReceivedRewardRequest;
import io.gs2.ranking2.result.CreateGlobalRankingReceivedRewardResult;

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

try {
    CreateGlobalRankingReceivedRewardResult result = client.createGlobalRankingReceivedReward(
        new CreateGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateGlobalRankingReceivedRewardResult> asyncResult = null;
yield return client.CreateGlobalRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.CreateGlobalRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createGlobalRankingReceivedReward(
        new Gs2Ranking2.CreateGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_global_ranking_received_reward(
        ranking2.CreateGlobalRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.create_global_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.create_global_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### createGlobalRankingReceivedRewardByUserId

ユーザーIDを指定してグローバルランキング報酬受け取り履歴を記録<br>

指定したユーザーに代わって、指定したグローバルランキングの報酬受け取り履歴を記録します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingReceivedReward](#globalrankingreceivedreward) | グローバルランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateGlobalRankingReceivedRewardByUserId(
    &ranking2.CreateGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createGlobalRankingReceivedRewardByUserId(
        (new CreateGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.CreateGlobalRankingReceivedRewardByUserIdResult;

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

try {
    CreateGlobalRankingReceivedRewardByUserIdResult result = client.createGlobalRankingReceivedRewardByUserId(
        new CreateGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.CreateGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.CreateGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.CreateGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_global_ranking_received_reward_by_user_id(
        ranking2.CreateGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.create_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.create_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### receiveGlobalRankingReceivedReward

グローバルランキング報酬受け取り<br>

指定したグローバルランキングとシーズンのランキング報酬を受け取ります。報酬はユーザーのランキング順位とランキングモデルの報酬設定によって決定されます。報酬アイテムを付与するためのトランザクションが発行されます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | トランザクションの変数に適用する設定値 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingModel](#globalrankingmodel) | グローバルランキングモデル |
| acquireActions | [List&lt;AcquireAction&gt;](#acquireaction) | 報酬受け取り時に実行される入手アクションのリスト |
| transactionId | string | 発行されたトランザクションID |
| stampSheet | string | 交換処理の実行に使用するスタンプシート |
| stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
| autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
| atomicCommit | bool? | トランザクションをアトミックにコミットするか |
| transaction | string | 発行されたトランザクション |
| transactionResult | [TransactionResult](#transactionresult) | トランザクション実行結果 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveGlobalRankingReceivedReward(
    &ranking2.ReceiveGlobalRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: pointy.Int64(0),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveGlobalRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveGlobalRankingReceivedReward(
        (new ReceiveGlobalRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(0)
            ->withConfig(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveGlobalRankingReceivedRewardRequest;
import io.gs2.ranking2.result.ReceiveGlobalRankingReceivedRewardResult;

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

try {
    ReceiveGlobalRankingReceivedRewardResult result = client.receiveGlobalRankingReceivedReward(
        new ReceiveGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0L)
            .withConfig(null)
    );
    GlobalRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveGlobalRankingReceivedRewardResult> asyncResult = null;
yield return client.ReceiveGlobalRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.ReceiveGlobalRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(0L)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveGlobalRankingReceivedReward(
        new Gs2Ranking2.ReceiveGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0)
            .withConfig(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_global_ranking_received_reward(
        ranking2.ReceiveGlobalRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(0)
            .with_config(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.receive_global_ranking_received_reward({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    config=nil,
})

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

result = api_result.result
item = result.item;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

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

client = gs2('ranking2')

api_result_handler = client.receive_global_ranking_received_reward_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```




---

### receiveGlobalRankingReceivedRewardByUserId

ユーザーIDを指定してグローバルランキング報酬受け取り<br>

指定したユーザーに代わって、指定したグローバルランキングとシーズンのランキング報酬を受け取ります。報酬アイテムを付与するためのトランザクションが発行されます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | トランザクションの変数に適用する設定値 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingModel](#globalrankingmodel) | グローバルランキングモデル |
| acquireActions | [List&lt;AcquireAction&gt;](#acquireaction) | 報酬受け取り時に実行される入手アクションのリスト |
| transactionId | string | 発行されたトランザクションID |
| stampSheet | string | 交換処理の実行に使用するスタンプシート |
| stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
| autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
| atomicCommit | bool? | トランザクションをアトミックにコミットするか |
| transaction | string | 発行されたトランザクション |
| transactionResult | [TransactionResult](#transactionresult) | トランザクション実行結果 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveGlobalRankingReceivedRewardByUserId(
    &ranking2.ReceiveGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: pointy.Int64(0),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveGlobalRankingReceivedRewardByUserId(
        (new ReceiveGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(0)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.ReceiveGlobalRankingReceivedRewardByUserIdResult;

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

try {
    ReceiveGlobalRankingReceivedRewardByUserIdResult result = client.receiveGlobalRankingReceivedRewardByUserId(
        new ReceiveGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(0L)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.ReceiveGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.ReceiveGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(0L)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.ReceiveGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(0)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_global_ranking_received_reward_by_user_id(
        ranking2.ReceiveGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(0)
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.receive_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

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

client = gs2('ranking2')

api_result_handler = client.receive_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```




---

### getGlobalRankingReceivedReward

グローバルランキング報酬受け取り履歴を取得<br>

指定したグローバルランキングの報酬受け取り履歴を取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingReceivedReward](#globalrankingreceivedreward) | グローバルランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingReceivedReward(
    &ranking2.GetGlobalRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingReceivedReward(
        (new GetGlobalRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingReceivedRewardRequest;
import io.gs2.ranking2.result.GetGlobalRankingReceivedRewardResult;

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

try {
    GetGlobalRankingReceivedRewardResult result = client.getGlobalRankingReceivedReward(
        new GetGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingReceivedRewardResult> asyncResult = null;
yield return client.GetGlobalRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingReceivedReward(
        new Gs2Ranking2.GetGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_received_reward(
        ranking2.GetGlobalRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### getGlobalRankingReceivedRewardByUserId

ユーザーIDを指定してグローバルランキング報酬受け取り履歴を取得<br>

指定したユーザーの指定したグローバルランキングの報酬受け取り履歴を取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingReceivedReward](#globalrankingreceivedreward) | グローバルランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingReceivedRewardByUserId(
    &ranking2.GetGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingReceivedRewardByUserId(
        (new GetGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.GetGlobalRankingReceivedRewardByUserIdResult;

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

try {
    GetGlobalRankingReceivedRewardByUserIdResult result = client.getGlobalRankingReceivedRewardByUserId(
        new GetGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.GetGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.GetGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_received_reward_by_user_id(
        ranking2.GetGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### deleteGlobalRankingReceivedRewardByUserId

ユーザーIDを指定してグローバルランキング報酬受け取り履歴を削除<br>

指定したユーザーの指定したランキングおよびシーズンのグローバルランキング報酬受け取り履歴を削除します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | ✓|  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。新しいランキング期間ごとに増加します。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingReceivedReward](#globalrankingreceivedreward) | 削除したグローバルランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteGlobalRankingReceivedRewardByUserId(
    &ranking2.DeleteGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteGlobalRankingReceivedRewardByUserId(
        (new DeleteGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.DeleteGlobalRankingReceivedRewardByUserIdResult;

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

try {
    DeleteGlobalRankingReceivedRewardByUserIdResult result = client.deleteGlobalRankingReceivedRewardByUserId(
        new DeleteGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.DeleteGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.DeleteGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_global_ranking_received_reward_by_user_id(
        ranking2.DeleteGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### describeGlobalRankings

グローバルランキングの一覧を取得<br>

指定したランキングのグローバルランキングデータのページネーション付きリストを取得します。ランキングデータには順位、スコア、ユーザー情報が含まれます。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingData&gt;](#globalrankingdata) | グローバルランキングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankings(
    &ranking2.DescribeGlobalRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankings(
        (new DescribeGlobalRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingsRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingsResult;

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

try {
    DescribeGlobalRankingsResult result = client.describeGlobalRankings(
        new DescribeGlobalRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingsResult> asyncResult = null;
yield return client.DescribeGlobalRankings(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankings(
        new Gs2Ranking2.DescribeGlobalRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(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 ranking2

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

try:
    result = client.describe_global_rankings(
        ranking2.DescribeGlobalRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(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('ranking2')

api_result = client.describe_global_rankings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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('ranking2')

api_result_handler = client.describe_global_rankings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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;

```




---

### describeGlobalRankingsByUserId

ユーザーIDを指定してグローバルランキングの一覧を取得<br>

指定したユーザーに代わって、指定したランキングのグローバルランキングデータのページネーション付きリストを取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingData&gt;](#globalrankingdata) | グローバルランキングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingsByUserId(
    &ranking2.DescribeGlobalRankingsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingsByUserId(
        (new DescribeGlobalRankingsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingsByUserIdRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingsByUserIdResult;

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

try {
    DescribeGlobalRankingsByUserIdResult result = client.describeGlobalRankingsByUserId(
        new DescribeGlobalRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<GlobalRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingsByUserIdResult> asyncResult = null;
yield return client.DescribeGlobalRankingsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingsByUserId(
        new Gs2Ranking2.DescribeGlobalRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_global_rankings_by_user_id(
        ranking2.DescribeGlobalRankingsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_global_rankings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### getGlobalRanking

グローバルランキングを取得<br>

指定したグローバルランキングにおけるリクエストしたユーザーの順位とスコアを取得します。ランキングデータは登録されたスコアから計算されます。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingData](#globalrankingdata) | グローバルランキング |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRanking(
    &ranking2.GetGlobalRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRanking(
        (new GetGlobalRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingRequest;
import io.gs2.ranking2.result.GetGlobalRankingResult;

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

try {
    GetGlobalRankingResult result = client.getGlobalRanking(
        new GetGlobalRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    GlobalRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingResult> asyncResult = null;
yield return client.GetGlobalRanking(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRanking(
        new Gs2Ranking2.GetGlobalRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking(
        ranking2.GetGlobalRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### getGlobalRankingByUserId

ユーザーIDを指定してグローバルランキングを取得<br>

指定したグローバルランキングにおける指定したユーザーの順位とスコアを取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingData](#globalrankingdata) | グローバルランキング |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingByUserId(
    &ranking2.GetGlobalRankingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingByUserId(
        (new GetGlobalRankingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingByUserIdRequest;
import io.gs2.ranking2.result.GetGlobalRankingByUserIdResult;

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

try {
    GetGlobalRankingByUserIdResult result = client.getGlobalRankingByUserId(
        new GetGlobalRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingByUserIdResult> asyncResult = null;
yield return client.GetGlobalRankingByUserId(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingByUserId(
        new Gs2Ranking2.GetGlobalRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_by_user_id(
        ranking2.GetGlobalRankingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### describeClusterRankingScores

クラスターランキングスコアの一覧を取得<br>

リクエストしたユーザーが登録したクラスターランキングスコアのページネーション付きリストを取得します。ランキング名、クラスター名、シーズンでフィルタリングできます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| rankingName | string |  | |  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | |  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingScore&gt;](#clusterrankingscore) | クラスターランキングスコアのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingScores(
    &ranking2.DescribeClusterRankingScoresRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingScoresRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingScores(
        (new DescribeClusterRankingScoresRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingScoresRequest;
import io.gs2.ranking2.result.DescribeClusterRankingScoresResult;

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

try {
    DescribeClusterRankingScoresResult result = client.describeClusterRankingScores(
        new DescribeClusterRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingScoresResult> asyncResult = null;
yield return client.DescribeClusterRankingScores(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingScoresRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingScores(
        new Gs2Ranking2.DescribeClusterRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .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 ranking2

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

try:
    result = client.describe_cluster_ranking_scores(
        ranking2.DescribeClusterRankingScoresRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .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('ranking2')

api_result = client.describe_cluster_ranking_scores({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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('ranking2')

api_result_handler = client.describe_cluster_ranking_scores_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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;

```




---

### describeClusterRankingScoresByUserId

ユーザーIDを指定してクラスターランキングスコアの一覧を取得<br>

指定したユーザーが登録したクラスターランキングスコアのページネーション付きリストを取得します。ランキング名、クラスター名、シーズンでフィルタリングできます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| rankingName | string |  | |  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | |  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingScore&gt;](#clusterrankingscore) | クラスターランキングスコアのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingScoresByUserId(
    &ranking2.DescribeClusterRankingScoresByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: nil,
        ClusterName: pointy.String("cluster-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingScoresByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingScoresByUserId(
        (new DescribeClusterRankingScoresByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName(null)
            ->withClusterName("cluster-0001")
            ->withSeason(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingScoresByUserIdRequest;
import io.gs2.ranking2.result.DescribeClusterRankingScoresByUserIdResult;

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

try {
    DescribeClusterRankingScoresByUserIdResult result = client.describeClusterRankingScoresByUserId(
        new DescribeClusterRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<ClusterRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingScoresByUserIdResult> asyncResult = null;
yield return client.DescribeClusterRankingScoresByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingScoresByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName(null)
        .WithClusterName("cluster-0001")
        .WithSeason(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingScoresByUserId(
        new Gs2Ranking2.DescribeClusterRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_ranking_scores_by_user_id(
        ranking2.DescribeClusterRankingScoresByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name(None)
            .with_cluster_name('cluster-0001')
            .with_season(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_cluster_ranking_scores_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    clusterName="cluster-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

api_result_handler = client.describe_cluster_ranking_scores_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    clusterName="cluster-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

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

```




---

### putClusterRankingScore

クラスターランキングスコアを登録<br>

指定したクラスターランキングにスコアを登録します。ユーザーは指定したクラスター（ギルドまたはマッチメイキングギャザリング）に所属している必要があります。スコアはランキングモデルで定義された範囲内である必要があります。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>このクラスター内でユーザーが登録したスコア値です。 |
| metadata | string |  | |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingScore](#clusterrankingscore) | 登録したクラスターランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutClusterRankingScore(
    &ranking2.PutClusterRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Score: pointy.Int64(100),
        Metadata: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutClusterRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putClusterRankingScore(
        (new PutClusterRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withScore(100)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutClusterRankingScoreRequest;
import io.gs2.ranking2.result.PutClusterRankingScoreResult;

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

try {
    PutClusterRankingScoreResult result = client.putClusterRankingScore(
        new PutClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100L)
            .withMetadata(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutClusterRankingScoreResult> asyncResult = null;
yield return client.PutClusterRankingScore(
    new Gs2.Gs2Ranking2.Request.PutClusterRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithScore(100L)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putClusterRankingScore(
        new Gs2Ranking2.PutClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_cluster_ranking_score(
        ranking2.PutClusterRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_score(100)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.put_cluster_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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('ranking2')

api_result_handler = client.put_cluster_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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;

```




---

### putClusterRankingScoreByUserId

ユーザーIDを指定してクラスターランキングスコアを登録<br>

指定したユーザーに代わって、指定したクラスターランキングにスコアを登録します。ユーザーは指定したクラスターに所属している必要があります。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>このクラスター内でユーザーが登録したスコア値です。 |
| metadata | string |  | |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingScore](#clusterrankingscore) | 登録したクラスターランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutClusterRankingScoreByUserId(
    &ranking2.PutClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Score: nil,
        Metadata: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putClusterRankingScoreByUserId(
        (new PutClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withScore(null)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.PutClusterRankingScoreByUserIdResult;

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

try {
    PutClusterRankingScoreByUserIdResult result = client.putClusterRankingScoreByUserId(
        new PutClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.PutClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.PutClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithScore(null)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putClusterRankingScoreByUserId(
        new Gs2Ranking2.PutClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_cluster_ranking_score_by_user_id(
        ranking2.PutClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_score(None)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.put_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    score=nil,
    metadata=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('ranking2')

api_result_handler = client.put_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    score=nil,
    metadata=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;

```




---

### getClusterRankingScore

クラスターランキングスコアを取得<br>

指定したランキングおよびクラスターに対してリクエストしたユーザーが登録したクラスターランキングスコアを取得します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingScore](#clusterrankingscore) | クラスターランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingScore(
    &ranking2.GetClusterRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingScore(
        (new GetClusterRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingScoreRequest;
import io.gs2.ranking2.result.GetClusterRankingScoreResult;

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

try {
    GetClusterRankingScoreResult result = client.getClusterRankingScore(
        new GetClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingScoreResult> asyncResult = null;
yield return client.GetClusterRankingScore(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingScore(
        new Gs2Ranking2.GetClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_score(
        ranking2.GetClusterRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### getClusterRankingScoreByUserId

ユーザーIDを指定してクラスターランキングスコアを取得<br>

指定したランキングおよびクラスターに対して指定したユーザーが登録したクラスターランキングスコアを取得します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingScore](#clusterrankingscore) | クラスターランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingScoreByUserId(
    &ranking2.GetClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingScoreByUserId(
        (new GetClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.GetClusterRankingScoreByUserIdResult;

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

try {
    GetClusterRankingScoreByUserIdResult result = client.getClusterRankingScoreByUserId(
        new GetClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.GetClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingScoreByUserId(
        new Gs2Ranking2.GetClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_score_by_user_id(
        ranking2.GetClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

```




---

### deleteClusterRankingScoreByUserId

ユーザーIDを指定してクラスターランキングスコアを削除<br>

指定したユーザーが指定したランキング、クラスター、シーズンに登録したクラスターランキングスコアを削除します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingScore](#clusterrankingscore) | 削除したクラスターランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteClusterRankingScoreByUserId(
    &ranking2.DeleteClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteClusterRankingScoreByUserId(
        (new DeleteClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.DeleteClusterRankingScoreByUserIdResult;

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

try {
    DeleteClusterRankingScoreByUserIdResult result = client.deleteClusterRankingScoreByUserId(
        new DeleteClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.DeleteClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteClusterRankingScoreByUserId(
        new Gs2Ranking2.DeleteClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_cluster_ranking_score_by_user_id(
        ranking2.DeleteClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

```




---

### verifyClusterRankingScore

クラスターランキングのスコアを検証<br>

クラスターランキングスコアを比較演算子（less, lessEqual, greater, greaterEqual, equal, notEqual）を使用して指定した値と比較検証します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| verifyType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"less",<br>&nbsp;&nbsp;"lessEqual",<br>&nbsp;&nbsp;"greater",<br>&nbsp;&nbsp;"greaterEqual",<br>&nbsp;&nbsp;"equal",<br>&nbsp;&nbsp;"notEqual"<br>}<br> |  | ✓|  |  | 検証の種類"less": スコアが指定値未満であること / "lessEqual": スコアが指定値以下であること / "greater": スコアが指定値超過であること / "greaterEqual": スコアが指定値以上であること / "equal": スコアが指定値と一致すること / "notEqual": スコアが指定値と一致しないこと /  |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>このクラスター内でユーザーが登録したスコア値です。 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 数量指定した際に、検証に使用する値も乗算するか |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingScore](#clusterrankingscore) | クラスターランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyClusterRankingScore(
    &ranking2.VerifyClusterRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyClusterRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyClusterRankingScore(
        (new VerifyClusterRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyClusterRankingScoreRequest;
import io.gs2.ranking2.result.VerifyClusterRankingScoreResult;

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

try {
    VerifyClusterRankingScoreResult result = client.verifyClusterRankingScore(
        new VerifyClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyClusterRankingScoreResult> asyncResult = null;
yield return client.VerifyClusterRankingScore(
    new Gs2.Gs2Ranking2.Request.VerifyClusterRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyClusterRankingScore(
        new Gs2Ranking2.VerifyClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_cluster_ranking_score(
        ranking2.VerifyClusterRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.verify_cluster_ranking_score({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_cluster_ranking_score_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

```




---

### verifyClusterRankingScoreByUserId

ユーザーIDを指定してクラスターランキングのスコアを検証<br>

指定したユーザーのクラスターランキングスコアを比較演算子（less, lessEqual, greater, greaterEqual, equal, notEqual）を使用して指定した値と比較検証します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このスコアが属するクラスター（ギルド、ギャザリング、または任意のグループ）の名前です。クラスタータイプ設定に基づいてユーザーの所属が検証されます。 |
| verifyType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"less",<br>&nbsp;&nbsp;"lessEqual",<br>&nbsp;&nbsp;"greater",<br>&nbsp;&nbsp;"greaterEqual",<br>&nbsp;&nbsp;"equal",<br>&nbsp;&nbsp;"notEqual"<br>}<br> |  | ✓|  |  | 検証の種類"less": スコアが指定値未満であること / "lessEqual": スコアが指定値以下であること / "greater": スコアが指定値超過であること / "greaterEqual": スコアが指定値以上であること / "equal": スコアが指定値と一致すること / "notEqual": スコアが指定値と一致しないこと /  |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア<br>このクラスター内でユーザーが登録したスコア値です。 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 数量指定した際に、検証に使用する値も乗算するか |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingScore](#clusterrankingscore) | クラスターランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyClusterRankingScoreByUserId(
    &ranking2.VerifyClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyClusterRankingScoreByUserId(
        (new VerifyClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.VerifyClusterRankingScoreByUserIdResult;

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

try {
    VerifyClusterRankingScoreByUserIdResult result = client.verifyClusterRankingScoreByUserId(
        new VerifyClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.VerifyClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.VerifyClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyClusterRankingScoreByUserId(
        new Gs2Ranking2.VerifyClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_cluster_ranking_score_by_user_id(
        ranking2.VerifyClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.verify_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

```




---

### describeClusterRankingReceivedRewards

クラスターランキング報酬受け取り履歴の一覧を取得<br>

リクエストしたユーザーのクラスターランキング報酬受け取り履歴のページネーション付きリストを取得します。ランキング名、クラスター名、シーズンでフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingReceivedReward&gt;](#clusterrankingreceivedreward) | クラスターランキング報酬受け取り履歴のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingReceivedRewards(
    &ranking2.DescribeClusterRankingReceivedRewardsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingReceivedRewardsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingReceivedRewards(
        (new DescribeClusterRankingReceivedRewardsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingReceivedRewardsRequest;
import io.gs2.ranking2.result.DescribeClusterRankingReceivedRewardsResult;

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

try {
    DescribeClusterRankingReceivedRewardsResult result = client.describeClusterRankingReceivedRewards(
        new DescribeClusterRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingReceivedRewardsResult> asyncResult = null;
yield return client.DescribeClusterRankingReceivedRewards(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingReceivedRewardsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingReceivedRewards(
        new Gs2Ranking2.DescribeClusterRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .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 ranking2

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

try:
    result = client.describe_cluster_ranking_received_rewards(
        ranking2.DescribeClusterRankingReceivedRewardsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .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('ranking2')

api_result = client.describe_cluster_ranking_received_rewards({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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('ranking2')

api_result_handler = client.describe_cluster_ranking_received_rewards_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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;

```




---

### describeClusterRankingReceivedRewardsByUserId

ユーザーIDを指定してクラスターランキング報酬受け取り履歴の一覧を取得<br>

指定したユーザーのクラスターランキング報酬受け取り履歴のページネーション付きリストを取得します。ランキング名、クラスター名、シーズンでフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingReceivedReward&gt;](#clusterrankingreceivedreward) | クラスターランキング報酬受け取り履歴のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingReceivedRewardsByUserId(
    &ranking2.DescribeClusterRankingReceivedRewardsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingReceivedRewardsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingReceivedRewardsByUserId(
        (new DescribeClusterRankingReceivedRewardsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingReceivedRewardsByUserIdRequest;
import io.gs2.ranking2.result.DescribeClusterRankingReceivedRewardsByUserIdResult;

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

try {
    DescribeClusterRankingReceivedRewardsByUserIdResult result = client.describeClusterRankingReceivedRewardsByUserId(
        new DescribeClusterRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<ClusterRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingReceivedRewardsByUserIdResult> asyncResult = null;
yield return client.DescribeClusterRankingReceivedRewardsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingReceivedRewardsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingReceivedRewardsByUserId(
        new Gs2Ranking2.DescribeClusterRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_ranking_received_rewards_by_user_id(
        ranking2.DescribeClusterRankingReceivedRewardsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_cluster_ranking_received_rewards_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

api_result_handler = client.describe_cluster_ranking_received_rewards_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

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

```




---

### createClusterRankingReceivedReward

クラスターランキング報酬受け取り履歴を記録<br>

指定したクラスターランキングおよびクラスターの報酬受け取り履歴を記録します。実際に報酬を受け取る前にこの記録が必要です。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingReceivedReward](#clusterrankingreceivedreward) | クラスターランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateClusterRankingReceivedReward(
    &ranking2.CreateClusterRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateClusterRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createClusterRankingReceivedReward(
        (new CreateClusterRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateClusterRankingReceivedRewardRequest;
import io.gs2.ranking2.result.CreateClusterRankingReceivedRewardResult;

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

try {
    CreateClusterRankingReceivedRewardResult result = client.createClusterRankingReceivedReward(
        new CreateClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateClusterRankingReceivedRewardResult> asyncResult = null;
yield return client.CreateClusterRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.CreateClusterRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createClusterRankingReceivedReward(
        new Gs2Ranking2.CreateClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_cluster_ranking_received_reward(
        ranking2.CreateClusterRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.create_cluster_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.create_cluster_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### createClusterRankingReceivedRewardByUserId

ユーザーIDを指定してクラスターランキング報酬受け取り履歴を記録<br>

指定したユーザーに代わって、指定したクラスターランキングおよびクラスターの報酬受け取り履歴を記録します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingReceivedReward](#clusterrankingreceivedreward) | クラスターランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateClusterRankingReceivedRewardByUserId(
    &ranking2.CreateClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createClusterRankingReceivedRewardByUserId(
        (new CreateClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.CreateClusterRankingReceivedRewardByUserIdResult;

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

try {
    CreateClusterRankingReceivedRewardByUserIdResult result = client.createClusterRankingReceivedRewardByUserId(
        new CreateClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.CreateClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.CreateClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.CreateClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_cluster_ranking_received_reward_by_user_id(
        ranking2.CreateClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.create_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.create_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

```




---

### receiveClusterRankingReceivedReward

クラスターランキング報酬受け取り<br>

指定したクラスターランキング、クラスター、シーズンのランキング報酬を受け取ります。報酬はユーザーのランキング順位とランキングモデルの報酬設定によって決定されます。報酬アイテムを付与するためのトランザクションが発行されます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | トランザクションの変数に適用する設定値 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingModel](#clusterrankingmodel) | クラスターランキングモデル |
| acquireActions | [List&lt;AcquireAction&gt;](#acquireaction) | 報酬受け取り時に実行される入手アクションのリスト |
| transactionId | string | 発行されたトランザクションID |
| stampSheet | string | 交換処理の実行に使用するスタンプシート |
| stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
| autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
| atomicCommit | bool? | トランザクションをアトミックにコミットするか |
| transaction | string | 発行されたトランザクション |
| transactionResult | [TransactionResult](#transactionresult) | トランザクション実行結果 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveClusterRankingReceivedReward(
    &ranking2.ReceiveClusterRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveClusterRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveClusterRankingReceivedReward(
        (new ReceiveClusterRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->withConfig(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveClusterRankingReceivedRewardRequest;
import io.gs2.ranking2.result.ReceiveClusterRankingReceivedRewardResult;

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

try {
    ReceiveClusterRankingReceivedRewardResult result = client.receiveClusterRankingReceivedReward(
        new ReceiveClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withConfig(null)
    );
    ClusterRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveClusterRankingReceivedRewardResult> asyncResult = null;
yield return client.ReceiveClusterRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.ReceiveClusterRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveClusterRankingReceivedReward(
        new Gs2Ranking2.ReceiveClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .withConfig(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_cluster_ranking_received_reward(
        ranking2.ReceiveClusterRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .with_config(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.receive_cluster_ranking_received_reward({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=nil,
})

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

result = api_result.result
item = result.item;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

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

client = gs2('ranking2')

api_result_handler = client.receive_cluster_ranking_received_reward_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```




---

### receiveClusterRankingReceivedRewardByUserId

ユーザーIDを指定してクラスターランキング報酬受け取り<br>

指定したユーザーに代わって、指定したクラスターランキング、クラスター、シーズンのランキング報酬を受け取ります。報酬アイテムを付与するためのトランザクションが発行されます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | トランザクションの変数に適用する設定値 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingModel](#clusterrankingmodel) | クラスターランキングモデル |
| acquireActions | [List&lt;AcquireAction&gt;](#acquireaction) | 報酬受け取り時に実行される入手アクションのリスト |
| transactionId | string | 発行されたトランザクションID |
| stampSheet | string | 交換処理の実行に使用するスタンプシート |
| stampSheetEncryptionKeyId | string | スタンプシートの署名計算に使用した暗号鍵GRN |
| autoRunStampSheet | bool? | トランザクションの自動実行が有効か |
| atomicCommit | bool? | トランザクションをアトミックにコミットするか |
| transaction | string | 発行されたトランザクション |
| transactionResult | [TransactionResult](#transactionresult) | トランザクション実行結果 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveClusterRankingReceivedRewardByUserId(
    &ranking2.ReceiveClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveClusterRankingReceivedRewardByUserId(
        (new ReceiveClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.ReceiveClusterRankingReceivedRewardByUserIdResult;

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

try {
    ReceiveClusterRankingReceivedRewardByUserIdResult result = client.receiveClusterRankingReceivedRewardByUserId(
        new ReceiveClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.ReceiveClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.ReceiveClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.ReceiveClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_cluster_ranking_received_reward_by_user_id(
        ranking2.ReceiveClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.receive_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

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

client = gs2('ranking2')

api_result_handler = client.receive_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```




---

### getClusterRankingReceivedReward

クラスターランキング報酬受け取り履歴を取得<br>

指定したクラスターランキングおよびクラスターの報酬受け取り履歴を取得します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingReceivedReward](#clusterrankingreceivedreward) | クラスターランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingReceivedReward(
    &ranking2.GetClusterRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingReceivedReward(
        (new GetClusterRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingReceivedRewardRequest;
import io.gs2.ranking2.result.GetClusterRankingReceivedRewardResult;

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

try {
    GetClusterRankingReceivedRewardResult result = client.getClusterRankingReceivedReward(
        new GetClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingReceivedRewardResult> asyncResult = null;
yield return client.GetClusterRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingReceivedReward(
        new Gs2Ranking2.GetClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_received_reward(
        ranking2.GetClusterRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### getClusterRankingReceivedRewardByUserId

ユーザーIDを指定してクラスターランキング報酬受け取り履歴を取得<br>

指定したユーザーの指定したクラスターランキングおよびクラスターの報酬受け取り履歴を取得します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingReceivedReward](#clusterrankingreceivedreward) | クラスターランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingReceivedRewardByUserId(
    &ranking2.GetClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingReceivedRewardByUserId(
        (new GetClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.GetClusterRankingReceivedRewardByUserIdResult;

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

try {
    GetClusterRankingReceivedRewardByUserIdResult result = client.getClusterRankingReceivedRewardByUserId(
        new GetClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.GetClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.GetClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_received_reward_by_user_id(
        ranking2.GetClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

```




---

### deleteClusterRankingReceivedRewardByUserId

ユーザーIDを指定してクラスターランキング報酬受け取り履歴を削除<br>

指定したユーザーの指定したランキング、クラスター、シーズンのクラスターランキング報酬受け取り履歴を削除します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>ランキング報酬を受け取ったクラスターの名前です。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | ✓|  | 0 ~ 9223372036854775805 | シーズン<br>GS2-Schedule イベントの繰り返し回数に対応するシーズン番号です。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingReceivedReward](#clusterrankingreceivedreward) | 削除したクラスターランキング報酬受け取り履歴 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteClusterRankingReceivedRewardByUserId(
    &ranking2.DeleteClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteClusterRankingReceivedRewardByUserId(
        (new DeleteClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.DeleteClusterRankingReceivedRewardByUserIdResult;

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

try {
    DeleteClusterRankingReceivedRewardByUserIdResult result = client.deleteClusterRankingReceivedRewardByUserId(
        new DeleteClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.DeleteClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.DeleteClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_cluster_ranking_received_reward_by_user_id(
        ranking2.DeleteClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

```




---

### describeClusterRankings

クラスターランキングの一覧を取得<br>

指定したランキングおよびクラスターのクラスターランキングデータのページネーション付きリストを取得します。ランキングデータには順位、スコア、ユーザー情報が含まれます。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このシーズンが属するクラスター（ギルド、ギャザリング、またはグループ）の名前です。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingData&gt;](#clusterrankingdata) | クラスターランキングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankings(
    &ranking2.DescribeClusterRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankings(
        (new DescribeClusterRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingsRequest;
import io.gs2.ranking2.result.DescribeClusterRankingsResult;

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

try {
    DescribeClusterRankingsResult result = client.describeClusterRankings(
        new DescribeClusterRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingsResult> asyncResult = null;
yield return client.DescribeClusterRankings(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankings(
        new Gs2Ranking2.DescribeClusterRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(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 ranking2

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

try:
    result = client.describe_cluster_rankings(
        ranking2.DescribeClusterRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(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('ranking2')

api_result = client.describe_cluster_rankings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=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('ranking2')

api_result_handler = client.describe_cluster_rankings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=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;

```




---

### describeClusterRankingsByUserId

ユーザーIDを指定してクラスターランキングの一覧を取得<br>

指定したユーザーに代わって、指定したランキングおよびクラスターのクラスターランキングデータのページネーション付きリストを取得します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このシーズンが属するクラスター（ギルド、ギャザリング、またはグループ）の名前です。 |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| pageToken | string |  | |  |  ~ 1024文字 | データの取得を開始する位置を指定するトークン |
| limit | int |  | | 30 | 1 ~ 1000 | データの取得件数 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingData&gt;](#clusterrankingdata) | クラスターランキングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingsByUserId(
    &ranking2.DescribeClusterRankingsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingsByUserId(
        (new DescribeClusterRankingsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingsByUserIdRequest;
import io.gs2.ranking2.result.DescribeClusterRankingsByUserIdResult;

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

try {
    DescribeClusterRankingsByUserIdResult result = client.describeClusterRankingsByUserId(
        new DescribeClusterRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<ClusterRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingsByUserIdResult> asyncResult = null;
yield return client.DescribeClusterRankingsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingsByUserId(
        new Gs2Ranking2.DescribeClusterRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_rankings_by_user_id(
        ranking2.DescribeClusterRankingsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_cluster_rankings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

api_result_handler = client.describe_cluster_rankings_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

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

```




---

### getClusterRanking

クラスターランキングを取得<br>

指定したクラスターランキングにおけるリクエストしたユーザーの順位とスコアを取得します。ランキングデータはクラスター内の登録されたスコアから計算されます。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このシーズンが属するクラスター（ギルド、ギャザリング、またはグループ）の名前です。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingData](#clusterrankingdata) | クラスターランキング |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRanking(
    &ranking2.GetClusterRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRanking(
        (new GetClusterRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingRequest;
import io.gs2.ranking2.result.GetClusterRankingResult;

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

try {
    GetClusterRankingResult result = client.getClusterRanking(
        new GetClusterRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    ClusterRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingResult> asyncResult = null;
yield return client.GetClusterRanking(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRanking(
        new Gs2Ranking2.GetClusterRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking(
        ranking2.GetClusterRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### getClusterRankingByUserId

ユーザーIDを指定してクラスターランキングを取得<br>

指定したクラスターランキングにおける指定したユーザーの順位とスコアを取得します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| clusterName | string |  | ✓|  |  ~ 1024文字 | クラスター名<br>このシーズンが属するクラスター（ギルド、ギャザリング、またはグループ）の名前です。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingData](#clusterrankingdata) | クラスターランキング |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingByUserId(
    &ranking2.GetClusterRankingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingByUserId(
        (new GetClusterRankingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingByUserIdRequest;
import io.gs2.ranking2.result.GetClusterRankingByUserIdResult;

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

try {
    GetClusterRankingByUserIdResult result = client.getClusterRankingByUserId(
        new GetClusterRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingByUserIdResult> asyncResult = null;
yield return client.GetClusterRankingByUserId(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingByUserId(
        new Gs2Ranking2.GetClusterRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_by_user_id(
        ranking2.GetClusterRankingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

```




---

### describeSubscribes

購読対象ユーザー情報の一覧を取得<br>

リクエストしたユーザーが購読ランキングのために購読しているユーザーのページネーション付きリストを取得します。ランキング名でフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeUser&gt;](#subscribeuser) | 購読対象ユーザー情報のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribes(
    &ranking2.DescribeSubscribesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribesRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribes(
        (new DescribeSubscribesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribesRequest;
import io.gs2.ranking2.result.DescribeSubscribesResult;

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

try {
    DescribeSubscribesResult result = client.describeSubscribes(
        new DescribeSubscribesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeUser> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribesResult> asyncResult = null;
yield return client.DescribeSubscribes(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribes(
        new Gs2Ranking2.DescribeSubscribesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_subscribes(
        ranking2.DescribeSubscribesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_subscribes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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('ranking2')

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

```




---

### describeSubscribesByUserId

ユーザーIDを指定して購読対象ユーザー情報の一覧を取得<br>

指定したユーザーが購読ランキングのために購読しているユーザーのページネーション付きリストを取得します。ランキング名でフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeUser&gt;](#subscribeuser) | 購読対象ユーザー情報のリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribesByUserId(
    &ranking2.DescribeSubscribesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribesByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribesByUserId(
        (new DescribeSubscribesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribesByUserIdRequest;
import io.gs2.ranking2.result.DescribeSubscribesByUserIdResult;

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

try {
    DescribeSubscribesByUserIdResult result = client.describeSubscribesByUserId(
        new DescribeSubscribesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SubscribeUser> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribesByUserIdResult> asyncResult = null;
yield return client.DescribeSubscribesByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribesByUserId(
        new Gs2Ranking2.DescribeSubscribesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_subscribes_by_user_id(
        ranking2.DescribeSubscribesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_subscribes_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-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('ranking2')

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

```




---

### addSubscribe

購読対象のユーザーIDを登録<br>

指定した購読ランキングにおいて、指定した対象ユーザーを購読します。対象ユーザーのスコアがリクエストしたユーザーの購読ランキングに含まれるようになります。購読が追加されると、対象ユーザーの既存スコアが購読者のランキングデータに同期されます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeUser](#subscribeuser) | 登録した購読対象ユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.AddSubscribe(
    &ranking2.AddSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\AddSubscribeRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->addSubscribe(
        (new AddSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.AddSubscribeRequest;
import io.gs2.ranking2.result.AddSubscribeResult;

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

try {
    AddSubscribeResult result = client.addSubscribe(
        new AddSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.AddSubscribeResult> asyncResult = null;
yield return client.AddSubscribe(
    new Gs2.Gs2Ranking2.Request.AddSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002"),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.addSubscribe(
        new Gs2Ranking2.AddSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.add_subscribe(
        ranking2.AddSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.add_subscribe({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

api_result_handler = client.add_subscribe_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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;

```




---

### addSubscribeByUserId

ユーザーIDを指定して購読対象のユーザーIDを登録<br>

指定したユーザーに代わって、指定した購読ランキングにおいて指定した対象ユーザーを購読します。既存のスコアが購読者のランキングデータに同期されます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeUser](#subscribeuser) | 登録した購読対象ユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.AddSubscribeByUserId(
    &ranking2.AddSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        TargetUserId: pointy.String("user-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\AddSubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->addSubscribeByUserId(
        (new AddSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withTargetUserId("user-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.AddSubscribeByUserIdRequest;
import io.gs2.ranking2.result.AddSubscribeByUserIdResult;

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

try {
    AddSubscribeByUserIdResult result = client.addSubscribeByUserId(
        new AddSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.AddSubscribeByUserIdResult> asyncResult = null;
yield return client.AddSubscribeByUserId(
    new Gs2.Gs2Ranking2.Request.AddSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithTargetUserId("user-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.addSubscribeByUserId(
        new Gs2Ranking2.AddSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.add_subscribe_by_user_id(
        ranking2.AddSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_target_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.add_subscribe_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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('ranking2')

api_result_handler = client.add_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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;

```




---

### describeSubscribeRankingScores

購読ランキングスコアの一覧を取得<br>

リクエストしたユーザーが登録した購読ランキングスコアのページネーション付きリストを取得します。ランキング名でフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeRankingScore&gt;](#subscriberankingscore) | 購読ランキングスコアのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingScores(
    &ranking2.DescribeSubscribeRankingScoresRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingScoresRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingScores(
        (new DescribeSubscribeRankingScoresRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingScoresRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingScoresResult;

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

try {
    DescribeSubscribeRankingScoresResult result = client.describeSubscribeRankingScores(
        new DescribeSubscribeRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingScoresResult> asyncResult = null;
yield return client.DescribeSubscribeRankingScores(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingScoresRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingScores(
        new Gs2Ranking2.DescribeSubscribeRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_subscribe_ranking_scores(
        ranking2.DescribeSubscribeRankingScoresRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_subscribe_ranking_scores({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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('ranking2')

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

```




---

### describeSubscribeRankingScoresByUserId

ユーザーIDを指定して購読ランキングスコアの一覧を取得<br>

指定したユーザーが登録した購読ランキングスコアのページネーション付きリストを取得します。ランキング名でフィルタリングできます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeRankingScore&gt;](#subscriberankingscore) | 購読ランキングスコアのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingScoresByUserId(
    &ranking2.DescribeSubscribeRankingScoresByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingScoresByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingScoresByUserId(
        (new DescribeSubscribeRankingScoresByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingScoresByUserIdRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingScoresByUserIdResult;

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

try {
    DescribeSubscribeRankingScoresByUserIdResult result = client.describeSubscribeRankingScoresByUserId(
        new DescribeSubscribeRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SubscribeRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingScoresByUserIdResult> asyncResult = null;
yield return client.DescribeSubscribeRankingScoresByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingScoresByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingScoresByUserId(
        new Gs2Ranking2.DescribeSubscribeRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_subscribe_ranking_scores_by_user_id(
        ranking2.DescribeSubscribeRankingScoresByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_subscribe_ranking_scores_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### putSubscribeRankingScore

購読ランキングスコアを登録<br>

指定した購読ランキングにスコアを登録します。スコアはすべての購読者のランキングデータに反映されます。スコアはランキングモデルで定義された範囲内である必要があります。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア |
| metadata | string |  | |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingScore](#subscriberankingscore) | 登録した購読ランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutSubscribeRankingScore(
    &ranking2.PutSubscribeRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Score: pointy.Int64(100),
        Metadata: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutSubscribeRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putSubscribeRankingScore(
        (new PutSubscribeRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withScore(100)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutSubscribeRankingScoreRequest;
import io.gs2.ranking2.result.PutSubscribeRankingScoreResult;

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

try {
    PutSubscribeRankingScoreResult result = client.putSubscribeRankingScore(
        new PutSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100L)
            .withMetadata(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutSubscribeRankingScoreResult> asyncResult = null;
yield return client.PutSubscribeRankingScore(
    new Gs2.Gs2Ranking2.Request.PutSubscribeRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithScore(100L)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putSubscribeRankingScore(
        new Gs2Ranking2.PutSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_subscribe_ranking_score(
        ranking2.PutSubscribeRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_score(100)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.put_subscribe_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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('ranking2')

api_result_handler = client.put_subscribe_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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;

```




---

### putSubscribeRankingScoreByUserId

ユーザーIDを指定して購読ランキングスコアを登録<br>

指定したユーザーに代わって、指定した購読ランキングにスコアを登録します。スコアはすべての購読者のランキングデータに反映されます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア |
| metadata | string |  | |  |  ~ 512文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingScore](#subscriberankingscore) | 登録した購読ランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutSubscribeRankingScoreByUserId(
    &ranking2.PutSubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Score: nil,
        Metadata: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutSubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putSubscribeRankingScoreByUserId(
        (new PutSubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withScore(null)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutSubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.PutSubscribeRankingScoreByUserIdResult;

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

try {
    PutSubscribeRankingScoreByUserIdResult result = client.putSubscribeRankingScoreByUserId(
        new PutSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutSubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.PutSubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.PutSubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithScore(null)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putSubscribeRankingScoreByUserId(
        new Gs2Ranking2.PutSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_subscribe_ranking_score_by_user_id(
        ranking2.PutSubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_score(None)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.put_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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('ranking2')

api_result_handler = client.put_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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;

```




---

### getSubscribeRankingScore

購読ランキングスコアを取得<br>

指定したランキングに対してリクエストしたユーザーが登録した購読ランキングスコアを取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingScore](#subscriberankingscore) | 購読ランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingScore(
    &ranking2.GetSubscribeRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingScore(
        (new GetSubscribeRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingScoreRequest;
import io.gs2.ranking2.result.GetSubscribeRankingScoreResult;

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

try {
    GetSubscribeRankingScoreResult result = client.getSubscribeRankingScore(
        new GetSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingScoreResult> asyncResult = null;
yield return client.GetSubscribeRankingScore(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingScore(
        new Gs2Ranking2.GetSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_score(
        ranking2.GetSubscribeRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_subscribe_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

```




---

### getSubscribeRankingScoreByUserId

ユーザーIDを指定して購読ランキングスコアを取得<br>

指定したランキングに対して指定したユーザーが登録した購読ランキングスコアを取得します。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingScore](#subscriberankingscore) | 購読ランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingScoreByUserId(
    &ranking2.GetSubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingScoreByUserId(
        (new GetSubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.GetSubscribeRankingScoreByUserIdResult;

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

try {
    GetSubscribeRankingScoreByUserIdResult result = client.getSubscribeRankingScoreByUserId(
        new GetSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.GetSubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingScoreByUserId(
        new Gs2Ranking2.GetSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_score_by_user_id(
        ranking2.GetSubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### deleteSubscribeRankingScoreByUserId

ユーザーIDを指定して購読ランキングスコアを削除<br>

指定したユーザーが指定したランキングおよびシーズンに登録した購読ランキングスコアを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingScore](#subscriberankingscore) | 削除した購読ランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribeRankingScoreByUserId(
    &ranking2.DeleteSubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribeRankingScoreByUserId(
        (new DeleteSubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.DeleteSubscribeRankingScoreByUserIdResult;

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

try {
    DeleteSubscribeRankingScoreByUserIdResult result = client.deleteSubscribeRankingScoreByUserId(
        new DeleteSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.DeleteSubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribeRankingScoreByUserId(
        new Gs2Ranking2.DeleteSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe_ranking_score_by_user_id(
        ranking2.DeleteSubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

```




---

### verifySubscribeRankingScore

購読ランキングのスコアを検証<br>

購読ランキングスコアを比較演算子（less, lessEqual, greater, greaterEqual, equal, notEqual）を使用して指定した値と比較検証します。オプションでシーズンを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| rankingName | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| verifyType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"less",<br>&nbsp;&nbsp;"lessEqual",<br>&nbsp;&nbsp;"greater",<br>&nbsp;&nbsp;"greaterEqual",<br>&nbsp;&nbsp;"equal",<br>&nbsp;&nbsp;"notEqual"<br>}<br> |  | ✓|  |  | 検証の種類"less": スコアが指定値未満であること / "lessEqual": スコアが指定値以下であること / "greater": スコアが指定値超過であること / "greaterEqual": スコアが指定値以上であること / "equal": スコアが指定値と一致すること / "notEqual": スコアが指定値と一致しないこと /  |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 数量指定した際に、検証に使用する値も乗算するか |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingScore](#subscriberankingscore) | 購読ランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifySubscribeRankingScore(
    &ranking2.VerifySubscribeRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifySubscribeRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifySubscribeRankingScore(
        (new VerifySubscribeRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifySubscribeRankingScoreRequest;
import io.gs2.ranking2.result.VerifySubscribeRankingScoreResult;

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

try {
    VerifySubscribeRankingScoreResult result = client.verifySubscribeRankingScore(
        new VerifySubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifySubscribeRankingScoreResult> asyncResult = null;
yield return client.VerifySubscribeRankingScore(
    new Gs2.Gs2Ranking2.Request.VerifySubscribeRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifySubscribeRankingScore(
        new Gs2Ranking2.VerifySubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_subscribe_ranking_score(
        ranking2.VerifySubscribeRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.verify_subscribe_ranking_score({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_subscribe_ranking_score_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

```




---

### verifySubscribeRankingScoreByUserId

ユーザーIDを指定して購読ランキングのスコアを検証<br>

指定したユーザーの購読ランキングスコアを比較演算子（less, lessEqual, greater, greaterEqual, equal, notEqual）を使用して指定した値と比較検証します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| rankingName | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| verifyType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"less",<br>&nbsp;&nbsp;"lessEqual",<br>&nbsp;&nbsp;"greater",<br>&nbsp;&nbsp;"greaterEqual",<br>&nbsp;&nbsp;"equal",<br>&nbsp;&nbsp;"notEqual"<br>}<br> |  | ✓|  |  | 検証の種類"less": スコアが指定値未満であること / "lessEqual": スコアが指定値以下であること / "greater": スコアが指定値超過であること / "greaterEqual": スコアが指定値以上であること / "equal": スコアが指定値と一致すること / "notEqual": スコアが指定値と一致しないこと /  |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| score | long |  | ✓|  | 0 ~ 9223372036854775805 | スコア |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 数量指定した際に、検証に使用する値も乗算するか |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingScore](#subscriberankingscore) | 購読ランキングスコア |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifySubscribeRankingScoreByUserId(
    &ranking2.VerifySubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifySubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifySubscribeRankingScoreByUserId(
        (new VerifySubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifySubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.VerifySubscribeRankingScoreByUserIdResult;

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

try {
    VerifySubscribeRankingScoreByUserIdResult result = client.verifySubscribeRankingScoreByUserId(
        new VerifySubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifySubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.VerifySubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.VerifySubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifySubscribeRankingScoreByUserId(
        new Gs2Ranking2.VerifySubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_subscribe_ranking_score_by_user_id(
        ranking2.VerifySubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.verify_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

```




---

### describeSubscribeRankings

購読ランキングの一覧を取得<br>

指定したランキングの購読ランキングデータのページネーション付きリストを取得します。ランキングにはリクエストしたユーザーが購読しているユーザーのスコアのみが含まれます。オプションでシーズンを指定できます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeRankingData&gt;](#subscriberankingdata) | 購読ランキングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankings(
    &ranking2.DescribeSubscribeRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankings(
        (new DescribeSubscribeRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingsRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingsResult;

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

try {
    DescribeSubscribeRankingsResult result = client.describeSubscribeRankings(
        new DescribeSubscribeRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingsResult> asyncResult = null;
yield return client.DescribeSubscribeRankings(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankings(
        new Gs2Ranking2.DescribeSubscribeRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(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 ranking2

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

try:
    result = client.describe_subscribe_rankings(
        ranking2.DescribeSubscribeRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(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('ranking2')

api_result = client.describe_subscribe_rankings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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('ranking2')

api_result_handler = client.describe_subscribe_rankings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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;

```




---

### describeSubscribeRankingsByUserId

ユーザーIDを指定して購読ランキングの一覧を取得<br>

指定したユーザーに代わって、指定したランキングの購読ランキングデータのページネーション付きリストを取得します。ランキングには指定したユーザーが購読しているユーザーのスコアのみが含まれます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeRankingData&gt;](#subscriberankingdata) | 購読ランキングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingsByUserId(
    &ranking2.DescribeSubscribeRankingsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingsByUserId(
        (new DescribeSubscribeRankingsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingsByUserIdRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingsByUserIdResult;

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

try {
    DescribeSubscribeRankingsByUserIdResult result = client.describeSubscribeRankingsByUserId(
        new DescribeSubscribeRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SubscribeRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingsByUserIdResult> asyncResult = null;
yield return client.DescribeSubscribeRankingsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingsByUserId(
        new Gs2Ranking2.DescribeSubscribeRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_subscribe_rankings_by_user_id(
        ranking2.DescribeSubscribeRankingsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_subscribe_rankings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### getSubscribeRanking

購読ランキングを取得<br>

購読ランキング内のリクエストしたユーザー（または指定したスコアラー）の順位とスコアを取得します。オプションでシーズンとスコアラーユーザーIDを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| scorerUserId | string |  | |  |  ~ 128文字 | スコアを獲得したユーザーID<br>このスコアを達成したプレイヤーのユーザーIDです。購読ランキングでは購読ユーザーのスコアがエントリとなるため、このフィールドはどのフレンドのスコアかを識別します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingData](#subscriberankingdata) | 購読ランキング |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRanking(
    &ranking2.GetSubscribeRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: nil,
        ScorerUserId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRanking(
        (new GetSubscribeRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(null)
            ->withScorerUserId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingRequest;
import io.gs2.ranking2.result.GetSubscribeRankingResult;

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

try {
    GetSubscribeRankingResult result = client.getSubscribeRanking(
        new GetSubscribeRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
            .withScorerUserId(null)
    );
    SubscribeRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingResult> asyncResult = null;
yield return client.GetSubscribeRanking(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(null)
        .WithScorerUserId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRanking(
        new Gs2Ranking2.GetSubscribeRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
            .withScorerUserId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking(
        ranking2.GetSubscribeRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(None)
            .with_scorer_user_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe_ranking({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=nil,
    scorerUserId=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('ranking2')

api_result_handler = client.get_subscribe_ranking_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=nil,
    scorerUserId=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;

```




---

### getSubscribeRankingByUserId

ユーザーIDを指定して購読ランキングを取得<br>

購読ランキング内の指定したユーザー（または指定したスコアラー）の順位とスコアを取得します。オプションでシーズンとスコアラーユーザーIDを指定できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| season | long |  | |  | 0 ~ 9223372036854775805 | シーズン |
| scorerUserId | string |  | |  |  ~ 128文字 | スコアを獲得したユーザーID<br>このスコアを達成したプレイヤーのユーザーIDです。購読ランキングでは購読ユーザーのスコアがエントリとなるため、このフィールドはどのフレンドのスコアかを識別します。 |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingData](#subscriberankingdata) | 購読ランキング |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingByUserId(
    &ranking2.GetSubscribeRankingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: nil,
        ScorerUserId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingByUserId(
        (new GetSubscribeRankingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(null)
            ->withScorerUserId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingByUserIdRequest;
import io.gs2.ranking2.result.GetSubscribeRankingByUserIdResult;

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

try {
    GetSubscribeRankingByUserIdResult result = client.getSubscribeRankingByUserId(
        new GetSubscribeRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withScorerUserId(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingByUserIdResult> asyncResult = null;
yield return client.GetSubscribeRankingByUserId(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(null)
        .WithScorerUserId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingByUserId(
        new Gs2Ranking2.GetSubscribeRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withScorerUserId(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_by_user_id(
        ranking2.GetSubscribeRankingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_scorer_user_id(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe_ranking_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=nil,
    scorerUserId=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('ranking2')

api_result_handler = client.get_subscribe_ranking_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=nil,
    scorerUserId=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;

```




---

### getSubscribe

購読対象ユーザー情報を取得<br>

指定した購読ランキングにおける指定した対象ユーザーの購読情報を取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeUser](#subscribeuser) | 購読対象ユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribe(
    &ranking2.GetSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribe(
        (new GetSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRequest;
import io.gs2.ranking2.result.GetSubscribeResult;

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

try {
    GetSubscribeResult result = client.getSubscribe(
        new GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeResult> asyncResult = null;
yield return client.GetSubscribe(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002"),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribe(
        new Gs2Ranking2.GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe(
        ranking2.GetSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

api_result_handler = client.get_subscribe_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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;

```




---

### getSubscribeByUserId

ユーザーIDを指定して購読対象ユーザー情報を取得<br>

指定したユーザーにおける、指定した購読ランキングの指定した対象ユーザーの購読情報を取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeUser](#subscribeuser) | 購読対象ユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeByUserId(
    &ranking2.GetSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        TargetUserId: pointy.String("user-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeByUserId(
        (new GetSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withTargetUserId("user-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeByUserIdRequest;
import io.gs2.ranking2.result.GetSubscribeByUserIdResult;

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

try {
    GetSubscribeByUserIdResult result = client.getSubscribeByUserId(
        new GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeByUserIdResult> asyncResult = null;
yield return client.GetSubscribeByUserId(
    new Gs2.Gs2Ranking2.Request.GetSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithTargetUserId("user-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeByUserId(
        new Gs2Ranking2.GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_by_user_id(
        ranking2.GetSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_target_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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('ranking2')

api_result_handler = client.get_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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;

```




---

### deleteSubscribe

購読対象のユーザーIDを削除<br>

指定した購読ランキングにおいて、指定した対象ユーザーの購読を解除します。対象ユーザーのスコアはリクエストしたユーザーの購読ランキングに表示されなくなります。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeUser](#subscribeuser) | 削除した購読対象ユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribe(
    &ranking2.DeleteSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribe(
        (new DeleteSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeRequest;
import io.gs2.ranking2.result.DeleteSubscribeResult;

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

try {
    DeleteSubscribeResult result = client.deleteSubscribe(
        new DeleteSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeResult> asyncResult = null;
yield return client.DeleteSubscribe(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002"),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribe(
        new Gs2Ranking2.DeleteSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe(
        ranking2.DeleteSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_subscribe({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

api_result_handler = client.delete_subscribe_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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;

```




---

### deleteSubscribeByUserId

ユーザーIDを指定して購読対象のユーザーIDを削除<br>

指定したユーザーに代わって、指定した購読ランキングにおいて指定した対象ユーザーの購読を解除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeUser](#subscribeuser) | 削除した購読対象ユーザー情報 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribeByUserId(
    &ranking2.DeleteSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        TargetUserId: pointy.String("user-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribeByUserId(
        (new DeleteSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withTargetUserId("user-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeByUserIdRequest;
import io.gs2.ranking2.result.DeleteSubscribeByUserIdResult;

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

try {
    DeleteSubscribeByUserIdResult result = client.deleteSubscribeByUserId(
        new DeleteSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeByUserIdResult> asyncResult = null;
yield return client.DeleteSubscribeByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithTargetUserId("user-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribeByUserId(
        new Gs2Ranking2.DeleteSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe_by_user_id(
        ranking2.DeleteSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_target_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_subscribe_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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('ranking2')

api_result_handler = client.delete_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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;

```




---

### describeGlobalRankingModels

グローバルランキングモデルの一覧を取得<br>

現在アクティブなグローバルランキングモデルの一覧を取得します。グローバルランキングモデルはスコア範囲、ソート順、報酬設定、エントリー/アクセス期間イベントなどのランキング設定を定義します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingModel&gt;](#globalrankingmodel) | グローバルランキングモデルのリスト |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingModels(
    &ranking2.DescribeGlobalRankingModelsRequest {
        NamespaceName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingModelsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingModels(
        (new DescribeGlobalRankingModelsRequest())
            ->withNamespaceName(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingModelsRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingModelsResult;

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

try {
    DescribeGlobalRankingModelsResult result = client.describeGlobalRankingModels(
        new DescribeGlobalRankingModelsRequest()
            .withNamespaceName(null)
    );
    List<GlobalRankingModel> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingModelsResult> asyncResult = null;
yield return client.DescribeGlobalRankingModels(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingModelsRequest()
        .WithNamespaceName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingModels(
        new Gs2Ranking2.DescribeGlobalRankingModelsRequest()
            .withNamespaceName(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_global_ranking_models(
        ranking2.DescribeGlobalRankingModelsRequest()
            .with_namespace_name(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_global_ranking_models({
    namespaceName=nil,
})

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

result = api_result.result
items = result.items;

```

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

client = gs2('ranking2')

api_result_handler = client.describe_global_ranking_models_async({
    namespaceName=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;

```




---

### getGlobalRankingModel

グローバルランキングモデルを取得<br>

スコア範囲、ソート順、ランキング報酬、エントリー/アクセス期間イベント設定を含む、指定されたグローバルランキングモデルを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingModel](#globalrankingmodel) | グローバルランキングモデル |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingModel(
    &ranking2.GetGlobalRankingModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingModelRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingModel(
        (new GetGlobalRankingModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingModelRequest;
import io.gs2.ranking2.result.GetGlobalRankingModelResult;

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

try {
    GetGlobalRankingModelResult result = client.getGlobalRankingModel(
        new GetGlobalRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    GlobalRankingModel 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingModelResult> asyncResult = null;
yield return client.GetGlobalRankingModel(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingModel(
        new Gs2Ranking2.GetGlobalRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_model(
        ranking2.GetGlobalRankingModelRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking_model({
    namespaceName="namespace-0001",
    rankingName="ranking-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('ranking2')

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

```




---

### describeClusterRankingModels

クラスターランキングモデルの一覧を取得<br>

現在アクティブなクラスターランキングモデルの一覧を取得します。クラスターランキングモデルはクラスタータイプ（ギルドまたはマッチメイキングギャザリング）、スコア範囲、ソート順、報酬設定、エントリー/アクセス期間イベントなどのランキング設定を定義します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingModel&gt;](#clusterrankingmodel) | クラスターランキングモデルのリスト |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingModels(
    &ranking2.DescribeClusterRankingModelsRequest {
        NamespaceName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingModelsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingModels(
        (new DescribeClusterRankingModelsRequest())
            ->withNamespaceName(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingModelsRequest;
import io.gs2.ranking2.result.DescribeClusterRankingModelsResult;

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

try {
    DescribeClusterRankingModelsResult result = client.describeClusterRankingModels(
        new DescribeClusterRankingModelsRequest()
            .withNamespaceName(null)
    );
    List<ClusterRankingModel> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingModelsResult> asyncResult = null;
yield return client.DescribeClusterRankingModels(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingModelsRequest()
        .WithNamespaceName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingModels(
        new Gs2Ranking2.DescribeClusterRankingModelsRequest()
            .withNamespaceName(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_ranking_models(
        ranking2.DescribeClusterRankingModelsRequest()
            .with_namespace_name(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_cluster_ranking_models({
    namespaceName=nil,
})

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

result = api_result.result
items = result.items;

```

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

client = gs2('ranking2')

api_result_handler = client.describe_cluster_ranking_models_async({
    namespaceName=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;

```




---

### getClusterRankingModel

クラスターランキングモデルを取得<br>

クラスタータイプ、スコア範囲、ソート順、ランキング報酬、エントリー/アクセス期間イベント設定を含む、指定されたクラスターランキングモデルを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingModel](#clusterrankingmodel) | クラスターランキングモデル |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingModel(
    &ranking2.GetClusterRankingModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingModelRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingModel(
        (new GetClusterRankingModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingModelRequest;
import io.gs2.ranking2.result.GetClusterRankingModelResult;

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

try {
    GetClusterRankingModelResult result = client.getClusterRankingModel(
        new GetClusterRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    ClusterRankingModel 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingModelResult> asyncResult = null;
yield return client.GetClusterRankingModel(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingModel(
        new Gs2Ranking2.GetClusterRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_model(
        ranking2.GetClusterRankingModelRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking_model({
    namespaceName="namespace-0001",
    rankingName="ranking-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('ranking2')

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

```




---

### describeSubscribeRankingModels

購読ランキングモデルの一覧を取得<br>

現在アクティブな購読ランキングモデルの一覧を取得します。購読ランキングモデルは、購読したフレンドとのみ競争するランキング設定を定義し、スコア範囲、ソート順、エントリー/アクセス期間イベントなどを含みます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeRankingModel&gt;](#subscriberankingmodel) | 購読ランキングモデルのリスト |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingModels(
    &ranking2.DescribeSubscribeRankingModelsRequest {
        NamespaceName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingModelsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingModels(
        (new DescribeSubscribeRankingModelsRequest())
            ->withNamespaceName(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingModelsRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingModelsResult;

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

try {
    DescribeSubscribeRankingModelsResult result = client.describeSubscribeRankingModels(
        new DescribeSubscribeRankingModelsRequest()
            .withNamespaceName(null)
    );
    List<SubscribeRankingModel> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingModelsResult> asyncResult = null;
yield return client.DescribeSubscribeRankingModels(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingModelsRequest()
        .WithNamespaceName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingModels(
        new Gs2Ranking2.DescribeSubscribeRankingModelsRequest()
            .withNamespaceName(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_subscribe_ranking_models(
        ranking2.DescribeSubscribeRankingModelsRequest()
            .with_namespace_name(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.describe_subscribe_ranking_models({
    namespaceName=nil,
})

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

result = api_result.result
items = result.items;

```

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

client = gs2('ranking2')

api_result_handler = client.describe_subscribe_ranking_models_async({
    namespaceName=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;

```




---

### getSubscribeRankingModel

購読ランキングモデルを取得<br>

スコア範囲、ソート順、エントリー/アクセス期間イベント設定を含む、指定された購読ランキングモデルを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingModel](#subscriberankingmodel) | 購読ランキングモデル |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingModel(
    &ranking2.GetSubscribeRankingModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingModelRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingModel(
        (new GetSubscribeRankingModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingModelRequest;
import io.gs2.ranking2.result.GetSubscribeRankingModelResult;

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

try {
    GetSubscribeRankingModelResult result = client.getSubscribeRankingModel(
        new GetSubscribeRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    SubscribeRankingModel 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingModelResult> asyncResult = null;
yield return client.GetSubscribeRankingModel(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingModel(
        new Gs2Ranking2.GetSubscribeRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_model(
        ranking2.GetSubscribeRankingModelRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe_ranking_model({
    namespaceName="namespace-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.get_subscribe_ranking_model_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
})

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

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

result = api_result.result
item = result.item;

```




---

### exportMaster

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

現在登録されているグローバル、クラスター、購読ランキングモデルマスターを有効化可能なマスターデータ形式でエクスポートします。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [CurrentRankingMaster](#currentrankingmaster) | モデルマスターを有効化可能なマスターデータ形式でエクスポート |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ExportMasterRequest;
import io.gs2.ranking2.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.export_master(
        ranking2.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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;

```




---

### getCurrentRankingMaster

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

グローバル、クラスター、購読ランキングモデル定義を含む、現在アクティブなランキングモデルのマスターデータを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [CurrentRankingMaster](#currentrankingmaster) | 現在アクティブなランキングモデルのマスターデータ |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetCurrentRankingMaster(
    &ranking2.GetCurrentRankingMasterRequest {
        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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getCurrentRankingMaster(
        (new GetCurrentRankingMasterRequest())
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetCurrentRankingMasterRequest;
import io.gs2.ranking2.result.GetCurrentRankingMasterResult;

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

try {
    GetCurrentRankingMasterResult result = client.getCurrentRankingMaster(
        new GetCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetCurrentRankingMasterResult> asyncResult = null;
yield return client.GetCurrentRankingMaster(
    new Gs2.Gs2Ranking2.Request.GetCurrentRankingMasterRequest()
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_current_ranking_master(
        ranking2.GetCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_current_ranking_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('ranking2')

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

```




---

### preUpdateCurrentRankingMaster

現在アクティブなランキングモデルのマスターデータを更新（3フェーズ版）<br>

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



#### 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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentRankingMaster(
    &ranking2.PreUpdateCurrentRankingMasterRequest {
        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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PreUpdateCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentRankingMaster(
        (new PreUpdateCurrentRankingMasterRequest())
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PreUpdateCurrentRankingMasterRequest;
import io.gs2.ranking2.result.PreUpdateCurrentRankingMasterResult;

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

try {
    PreUpdateCurrentRankingMasterResult result = client.preUpdateCurrentRankingMaster(
        new PreUpdateCurrentRankingMasterRequest()
            .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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PreUpdateCurrentRankingMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentRankingMaster(
    new Gs2.Gs2Ranking2.Request.PreUpdateCurrentRankingMasterRequest()
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.preUpdateCurrentRankingMaster(
        new Gs2Ranking2.PreUpdateCurrentRankingMasterRequest()
            .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 ranking2

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

try:
    result = client.pre_update_current_ranking_master(
        ranking2.PreUpdateCurrentRankingMasterRequest()
            .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('ranking2')

api_result = client.pre_update_current_ranking_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('ranking2')

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

```




---

### updateCurrentRankingMaster

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

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



#### Request

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

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRankingMaster(
    &ranking2.UpdateCurrentRankingMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}"),
        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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateCurrentRankingMaster(
        (new UpdateCurrentRankingMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateCurrentRankingMasterRequest;
import io.gs2.ranking2.result.UpdateCurrentRankingMasterResult;

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

try {
    UpdateCurrentRankingMasterResult result = client.updateCurrentRankingMaster(
        new UpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
            .withUploadToken(null)
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateCurrentRankingMasterResult> asyncResult = null;
yield return client.UpdateCurrentRankingMaster(
    new Gs2.Gs2Ranking2.Request.UpdateCurrentRankingMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateCurrentRankingMaster(
        new Gs2Ranking2.UpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_current_ranking_master(
        ranking2.UpdateCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-05-30", "globalRankingModels": [{"name": "ranking-0001", "orderDirection": "asc"}, {"name": "ranking-0002", "orderDirection": "desc"}], "clusterRankingModels": [{"name": "ranking-0001", "clusterType": "Raw", "orderDirection": "asc"}, {"name": "ranking-0002", "clusterType": "Gs2Guild::Guild", "orderDirection": "desc"}], "subscribeRankingModels": [{"name": "ranking-0001", "orderDirection": "asc"}, {"name": "ranking-0002", "orderDirection": "desc"}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.update_current_ranking_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}",
    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('ranking2')

api_result_handler = client.update_current_ranking_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}",
    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;

```




---

### updateCurrentRankingMasterFromGitHub

現在アクティブなランキングモデルのマスターデータをGitHubから更新<br>

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



#### Request

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

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRankingMasterFromGitHub(
    &ranking2.UpdateCurrentRankingMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateCurrentRankingMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateCurrentRankingMasterFromGitHub(
        (new UpdateCurrentRankingMasterFromGitHubRequest())
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateCurrentRankingMasterFromGitHubRequest;
import io.gs2.ranking2.result.UpdateCurrentRankingMasterFromGitHubResult;

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

try {
    UpdateCurrentRankingMasterFromGitHubResult result = client.updateCurrentRankingMasterFromGitHub(
        new UpdateCurrentRankingMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateCurrentRankingMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentRankingMasterFromGitHub(
    new Gs2.Gs2Ranking2.Request.UpdateCurrentRankingMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateCurrentRankingMasterFromGitHub(
        new Gs2Ranking2.UpdateCurrentRankingMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Ranking2.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 ranking2

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

try:
    result = client.update_current_ranking_master_from_git_hub(
        ranking2.UpdateCurrentRankingMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(ranking2.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('ranking2')

api_result = client.update_current_ranking_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('ranking2')

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

```




---

### describeGlobalRankingModelMasters

グローバルランキングモデルマスターの一覧を取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;GlobalRankingModelMaster&gt;](#globalrankingmodelmaster) | グローバルランキングモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingModelMasters(
    &ranking2.DescribeGlobalRankingModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingModelMastersRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingModelMasters(
        (new DescribeGlobalRankingModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingModelMastersRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingModelMastersResult;

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

try {
    DescribeGlobalRankingModelMastersResult result = client.describeGlobalRankingModelMasters(
        new DescribeGlobalRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingModelMaster> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingModelMastersResult> asyncResult = null;
yield return client.DescribeGlobalRankingModelMasters(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingModelMasters(
        new Gs2Ranking2.DescribeGlobalRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_global_ranking_model_masters(
        ranking2.DescribeGlobalRankingModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### createGlobalRankingModelMaster

グローバルランキングモデルマスターを新規作成<br>

スコア範囲、ソート順、合計モード、ランキング報酬、報酬計算インデックス、エントリー/アクセス期間イベント設定を持つ新しいグローバルランキングモデルマスターを作成します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| name | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。無効または意図しないスコア値のフィルタリングに使用します。 |
| maximumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。異常に高いスコアの登録防止に使用します。 |
| sum | bool |  | | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、ソート方向に応じた最良のスコア（最高値または最低値）のみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓|  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合（例：タイムアタック）は「昇順」、高いスコアほど上位の場合（例：ハイスコア）は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null | | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。各報酬は順位閾値と実行する入手アクションを定義します。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  | | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位を使用し（同スコアのプレイヤーは同じ順位を共有）、「インデックスベース」は0始まりの一意のソート位置を使用します（同順位なし）。通常のユースケースでは「順位ベース」を選択してください。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |
| entryPeriodEventId | string |  | |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、繰り返しサイクルごとにランキングがリセットされ、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  | |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。通常、スコア登録期間の間のインターバルに設定します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingModelMaster](#globalrankingmodelmaster) | 作成したグローバルランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateGlobalRankingModelMaster(
    &ranking2.CreateGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("global-0001"),
        Description: nil,
        Metadata: nil,
        MinimumValue: nil,
        MaximumValue: nil,
        Sum: nil,
        OrderDirection: pointy.String("asc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createGlobalRankingModelMaster(
        (new CreateGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("global-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMinimumValue(null)
            ->withMaximumValue(null)
            ->withSum(null)
            ->withOrderDirection("asc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.CreateGlobalRankingModelMasterResult;

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

try {
    CreateGlobalRankingModelMasterResult result = client.createGlobalRankingModelMaster(
        new CreateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("global-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateGlobalRankingModelMasterResult> asyncResult = null;
yield return client.CreateGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.CreateGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("global-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMinimumValue(null)
        .WithMaximumValue(null)
        .WithSum(null)
        .WithOrderDirection("asc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createGlobalRankingModelMaster(
        new Gs2Ranking2.CreateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("global-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_global_ranking_model_master(
        ranking2.CreateGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('global-0001')
            .with_description(None)
            .with_metadata(None)
            .with_minimum_value(None)
            .with_maximum_value(None)
            .with_sum(None)
            .with_order_direction('asc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.create_global_ranking_model_master({
    namespaceName="namespace-0001",
    name="global-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.create_global_ranking_model_master_async({
    namespaceName="namespace-0001",
    name="global-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

```




---

### getGlobalRankingModelMaster

グローバルランキングモデルマスターを取得<br>

指定されたグローバルランキングモデルマスターを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingModelMaster](#globalrankingmodelmaster) | グローバルランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingModelMaster(
    &ranking2.GetGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("global-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingModelMaster(
        (new GetGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("global-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.GetGlobalRankingModelMasterResult;

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

try {
    GetGlobalRankingModelMasterResult result = client.getGlobalRankingModelMaster(
        new GetGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingModelMasterResult> asyncResult = null;
yield return client.GetGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("global-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingModelMaster(
        new Gs2Ranking2.GetGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_model_master(
        ranking2.GetGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('global-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_global_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="global-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('ranking2')

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

```




---

### updateGlobalRankingModelMaster

グローバルランキングモデルマスターを更新<br>

指定されたグローバルランキングモデルマスターのスコア範囲、ソート順、合計モード、ランキング報酬、報酬計算インデックス、エントリー/アクセス期間イベント設定を更新します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | グローバルランキングモデル名<br>グローバルランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。無効または意図しないスコア値のフィルタリングに使用します。 |
| maximumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。異常に高いスコアの登録防止に使用します。 |
| sum | bool |  | | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、ソート方向に応じた最良のスコア（最高値または最低値）のみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓|  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合（例：タイムアタック）は「昇順」、高いスコアほど上位の場合（例：ハイスコア）は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null | | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。各報酬は順位閾値と実行する入手アクションを定義します。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  | | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位を使用し（同スコアのプレイヤーは同じ順位を共有）、「インデックスベース」は0始まりの一意のソート位置を使用します（同順位なし）。通常のユースケースでは「順位ベース」を選択してください。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |
| entryPeriodEventId | string |  | |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、繰り返しサイクルごとにランキングがリセットされ、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  | |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。通常、スコア登録期間の間のインターバルに設定します。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingModelMaster](#globalrankingmodelmaster) | 更新したグローバルランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateGlobalRankingModelMaster(
    &ranking2.UpdateGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("global-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("CATEGORY_0001"),
        MinimumValue: pointy.Int64(100),
        MaximumValue: pointy.Int64(10000),
        Sum: nil,
        OrderDirection: pointy.String("desc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateGlobalRankingModelMaster(
        (new UpdateGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("global-0001")
            ->withDescription("description1")
            ->withMetadata("CATEGORY_0001")
            ->withMinimumValue(100)
            ->withMaximumValue(10000)
            ->withSum(null)
            ->withOrderDirection("desc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.UpdateGlobalRankingModelMasterResult;

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

try {
    UpdateGlobalRankingModelMasterResult result = client.updateGlobalRankingModelMaster(
        new UpdateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100L)
            .withMaximumValue(10000L)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateGlobalRankingModelMasterResult> asyncResult = null;
yield return client.UpdateGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.UpdateGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("global-0001")
        .WithDescription("description1")
        .WithMetadata("CATEGORY_0001")
        .WithMinimumValue(100L)
        .WithMaximumValue(10000L)
        .WithSum(null)
        .WithOrderDirection("desc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateGlobalRankingModelMaster(
        new Gs2Ranking2.UpdateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100)
            .withMaximumValue(10000)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_global_ranking_model_master(
        ranking2.UpdateGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('global-0001')
            .with_description('description1')
            .with_metadata('CATEGORY_0001')
            .with_minimum_value(100)
            .with_maximum_value(10000)
            .with_sum(None)
            .with_order_direction('desc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.update_global_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="global-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.update_global_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="global-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

```




---

### deleteGlobalRankingModelMaster

グローバルランキングモデルマスターを削除<br>

指定されたグローバルランキングモデルマスターを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [GlobalRankingModelMaster](#globalrankingmodelmaster) | 削除したグローバルランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteGlobalRankingModelMaster(
    &ranking2.DeleteGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("global-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteGlobalRankingModelMaster(
        (new DeleteGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("global-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.DeleteGlobalRankingModelMasterResult;

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

try {
    DeleteGlobalRankingModelMasterResult result = client.deleteGlobalRankingModelMaster(
        new DeleteGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteGlobalRankingModelMasterResult> asyncResult = null;
yield return client.DeleteGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.DeleteGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("global-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteGlobalRankingModelMaster(
        new Gs2Ranking2.DeleteGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_global_ranking_model_master(
        ranking2.DeleteGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('global-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_global_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="global-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('ranking2')

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

```




---

### describeClusterRankingModelMasters

クラスターランキングモデルマスターの一覧を取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;ClusterRankingModelMaster&gt;](#clusterrankingmodelmaster) | クラスターランキングモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingModelMasters(
    &ranking2.DescribeClusterRankingModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingModelMastersRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingModelMasters(
        (new DescribeClusterRankingModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingModelMastersRequest;
import io.gs2.ranking2.result.DescribeClusterRankingModelMastersResult;

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

try {
    DescribeClusterRankingModelMastersResult result = client.describeClusterRankingModelMasters(
        new DescribeClusterRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingModelMaster> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingModelMastersResult> asyncResult = null;
yield return client.DescribeClusterRankingModelMasters(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingModelMasters(
        new Gs2Ranking2.DescribeClusterRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_ranking_model_masters(
        ranking2.DescribeClusterRankingModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### createClusterRankingModelMaster

クラスターランキングモデルマスターを新規作成<br>

クラスタータイプ、スコア範囲、ソート順、合計モード、ランキング報酬、報酬計算インデックス、エントリー/アクセス期間イベント設定を持つ新しいクラスターランキングモデルマスターを作成します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| name | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| clusterType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"Raw",<br>&nbsp;&nbsp;"Gs2Guild::Guild",<br>&nbsp;&nbsp;"Gs2Matchmaking::SeasonGathering"<br>}<br> |  | ✓|  |  | クラスタータイプ<br>ランキングのセグメンテーションに使用するグループ（クラスター）の種類を定義します。「Raw」は所属検証なしで任意のクラスター名を指定でき、「Gs2Guild::Guild」はGS2-Guildギルドへの所属を検証し、「Gs2Matchmaking::SeasonGathering」はGS2-Matchmakingシーズンギャザリングへの所属を検証します。"Raw": 検証なし / "Gs2Guild::Guild": GS2-Guild ギルド / "Gs2Matchmaking::SeasonGathering": GS2-Matchmaking シーズンギャザリング /  |
| minimumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  | | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓|  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null | | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  | | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位（同スコアは同順位）、「インデックスベース」は0始まりの一意のソート位置（同順位なし）を使用します。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |
| entryPeriodEventId | string |  | |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  | |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingModelMaster](#clusterrankingmodelmaster) | 作成したクラスターランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateClusterRankingModelMaster(
    &ranking2.CreateClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("cluster-0001"),
        Description: nil,
        Metadata: nil,
        ClusterType: pointy.String("Raw"),
        MinimumValue: nil,
        MaximumValue: nil,
        Sum: nil,
        OrderDirection: pointy.String("asc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createClusterRankingModelMaster(
        (new CreateClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("cluster-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withClusterType("Raw")
            ->withMinimumValue(null)
            ->withMaximumValue(null)
            ->withSum(null)
            ->withOrderDirection("asc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.CreateClusterRankingModelMasterResult;

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

try {
    CreateClusterRankingModelMasterResult result = client.createClusterRankingModelMaster(
        new CreateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("cluster-0001")
            .withDescription(null)
            .withMetadata(null)
            .withClusterType("Raw")
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateClusterRankingModelMasterResult> asyncResult = null;
yield return client.CreateClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.CreateClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("cluster-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithClusterType("Raw")
        .WithMinimumValue(null)
        .WithMaximumValue(null)
        .WithSum(null)
        .WithOrderDirection("asc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createClusterRankingModelMaster(
        new Gs2Ranking2.CreateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("cluster-0001")
            .withDescription(null)
            .withMetadata(null)
            .withClusterType("Raw")
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_cluster_ranking_model_master(
        ranking2.CreateClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('cluster-0001')
            .with_description(None)
            .with_metadata(None)
            .with_cluster_type('Raw')
            .with_minimum_value(None)
            .with_maximum_value(None)
            .with_sum(None)
            .with_order_direction('asc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.create_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    name="cluster-0001",
    description=nil,
    metadata=nil,
    clusterType="Raw",
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.create_cluster_ranking_model_master_async({
    namespaceName="namespace-0001",
    name="cluster-0001",
    description=nil,
    metadata=nil,
    clusterType="Raw",
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

```




---

### getClusterRankingModelMaster

クラスターランキングモデルマスターを取得<br>

指定されたクラスターランキングモデルマスターを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingModelMaster](#clusterrankingmodelmaster) | クラスターランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingModelMaster(
    &ranking2.GetClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("cluster-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingModelMaster(
        (new GetClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("cluster-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.GetClusterRankingModelMasterResult;

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

try {
    GetClusterRankingModelMasterResult result = client.getClusterRankingModelMaster(
        new GetClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingModelMasterResult> asyncResult = null;
yield return client.GetClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("cluster-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingModelMaster(
        new Gs2Ranking2.GetClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_model_master(
        ranking2.GetClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('cluster-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="cluster-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('ranking2')

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

```




---

### updateClusterRankingModelMaster

クラスターランキングモデルマスターを更新<br>

指定されたクラスターランキングモデルマスターのクラスタータイプ、スコア範囲、ソート順、合計モード、ランキング報酬、報酬計算インデックス、エントリー/アクセス期間イベント設定を更新します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | クラスターランキングモデル名<br>クラスターランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| clusterType | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"Raw",<br>&nbsp;&nbsp;"Gs2Guild::Guild",<br>&nbsp;&nbsp;"Gs2Matchmaking::SeasonGathering"<br>}<br> |  | ✓|  |  | クラスタータイプ<br>ランキングのセグメンテーションに使用するグループ（クラスター）の種類を定義します。「Raw」は所属検証なしで任意のクラスター名を指定でき、「Gs2Guild::Guild」はGS2-Guildギルドへの所属を検証し、「Gs2Matchmaking::SeasonGathering」はGS2-Matchmakingシーズンギャザリングへの所属を検証します。"Raw": 検証なし / "Gs2Guild::Guild": GS2-Guild ギルド / "Gs2Matchmaking::SeasonGathering": GS2-Matchmaking シーズンギャザリング /  |
| minimumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  | | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓|  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| rankingRewards | [List&lt;RankingReward&gt;](#rankingreward) | {entryPeriodEventId} != null | | [] | 0 ~ 100 items | ランキング報酬リスト<br>各シーズン終了時のランキング順位に基づいて付与される報酬のリストです。スコア登録可能期間イベントが設定されている場合のみ利用可能です。 |
| rewardCalculationIndex | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"rank",<br>&nbsp;&nbsp;"index"<br>}<br> |  | | "rank" |  | 報酬計算インデックス<br>報酬をプレイヤーに対応付ける方法を決定します。「順位ベース」は1始まりのランキング順位（同スコアは同順位）、「インデックスベース」は0始まりの一意のソート位置（同順位なし）を使用します。"rank": 順位ベースで報酬を決定 / "index": インデックスベースで報酬を決定 /  |
| entryPeriodEventId | string |  | |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  | |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧と報酬の受け取りが可能な期間を定義する GS2-Schedule のイベントGRNです。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingModelMaster](#clusterrankingmodelmaster) | 更新したクラスターランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateClusterRankingModelMaster(
    &ranking2.UpdateClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("cluster-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("CATEGORY_0001"),
        ClusterType: pointy.String("Gs2Guild::Guild"),
        MinimumValue: pointy.Int64(100),
        MaximumValue: pointy.Int64(10000),
        Sum: nil,
        OrderDirection: pointy.String("desc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateClusterRankingModelMaster(
        (new UpdateClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("cluster-0001")
            ->withDescription("description1")
            ->withMetadata("CATEGORY_0001")
            ->withClusterType("Gs2Guild::Guild")
            ->withMinimumValue(100)
            ->withMaximumValue(10000)
            ->withSum(null)
            ->withOrderDirection("desc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.UpdateClusterRankingModelMasterResult;

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

try {
    UpdateClusterRankingModelMasterResult result = client.updateClusterRankingModelMaster(
        new UpdateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withClusterType("Gs2Guild::Guild")
            .withMinimumValue(100L)
            .withMaximumValue(10000L)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateClusterRankingModelMasterResult> asyncResult = null;
yield return client.UpdateClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.UpdateClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("cluster-0001")
        .WithDescription("description1")
        .WithMetadata("CATEGORY_0001")
        .WithClusterType("Gs2Guild::Guild")
        .WithMinimumValue(100L)
        .WithMaximumValue(10000L)
        .WithSum(null)
        .WithOrderDirection("desc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateClusterRankingModelMaster(
        new Gs2Ranking2.UpdateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withClusterType("Gs2Guild::Guild")
            .withMinimumValue(100)
            .withMaximumValue(10000)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_cluster_ranking_model_master(
        ranking2.UpdateClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('cluster-0001')
            .with_description('description1')
            .with_metadata('CATEGORY_0001')
            .with_cluster_type('Gs2Guild::Guild')
            .with_minimum_value(100)
            .with_maximum_value(10000)
            .with_sum(None)
            .with_order_direction('desc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.update_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="cluster-0001",
    description="description1",
    metadata="CATEGORY_0001",
    clusterType="Gs2Guild::Guild",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.update_cluster_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="cluster-0001",
    description="description1",
    metadata="CATEGORY_0001",
    clusterType="Gs2Guild::Guild",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

```




---

### deleteClusterRankingModelMaster

クラスターランキングモデルマスターを削除<br>

指定されたクラスターランキングモデルマスターを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [ClusterRankingModelMaster](#clusterrankingmodelmaster) | 削除したクラスターランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteClusterRankingModelMaster(
    &ranking2.DeleteClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("cluster-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteClusterRankingModelMaster(
        (new DeleteClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("cluster-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.DeleteClusterRankingModelMasterResult;

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

try {
    DeleteClusterRankingModelMasterResult result = client.deleteClusterRankingModelMaster(
        new DeleteClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteClusterRankingModelMasterResult> asyncResult = null;
yield return client.DeleteClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.DeleteClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("cluster-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteClusterRankingModelMaster(
        new Gs2Ranking2.DeleteClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_cluster_ranking_model_master(
        ranking2.DeleteClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('cluster-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="cluster-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('ranking2')

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

```




---

### describeSubscribeRankingModelMasters

購読ランキングモデルマスターの一覧を取得<br>

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



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SubscribeRankingModelMaster&gt;](#subscriberankingmodelmaster) | 購読ランキングモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingModelMasters(
    &ranking2.DescribeSubscribeRankingModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingModelMastersRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingModelMasters(
        (new DescribeSubscribeRankingModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingModelMastersRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingModelMastersResult;

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

try {
    DescribeSubscribeRankingModelMastersResult result = client.describeSubscribeRankingModelMasters(
        new DescribeSubscribeRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeRankingModelMaster> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingModelMastersResult> asyncResult = null;
yield return client.DescribeSubscribeRankingModelMasters(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingModelMasters(
        new Gs2Ranking2.DescribeSubscribeRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_subscribe_ranking_model_masters(
        ranking2.DescribeSubscribeRankingModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

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

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

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

```

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

client = gs2('ranking2')

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

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

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

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

```




---

### createSubscribeRankingModelMaster

購読ランキングモデルマスターを新規作成<br>

スコア範囲、ソート順、合計モード、エントリー/アクセス期間イベント設定を持つ新しい購読ランキングモデルマスターを作成します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| name | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  | | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓|  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  | |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  | |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧が可能な期間を定義する GS2-Schedule のイベントGRNです。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingModelMaster](#subscriberankingmodelmaster) | 作成した購読ランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateSubscribeRankingModelMaster(
    &ranking2.CreateSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("subscribe-0001"),
        Description: nil,
        Metadata: nil,
        MinimumValue: nil,
        MaximumValue: nil,
        Sum: nil,
        OrderDirection: pointy.String("asc"),
        EntryPeriodEventId: nil,
        AccessPeriodEventId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createSubscribeRankingModelMaster(
        (new CreateSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("subscribe-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMinimumValue(null)
            ->withMaximumValue(null)
            ->withSum(null)
            ->withOrderDirection("asc")
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.CreateSubscribeRankingModelMasterResult;

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

try {
    CreateSubscribeRankingModelMasterResult result = client.createSubscribeRankingModelMaster(
        new CreateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("subscribe-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.CreateSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.CreateSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("subscribe-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMinimumValue(null)
        .WithMaximumValue(null)
        .WithSum(null)
        .WithOrderDirection("asc")
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createSubscribeRankingModelMaster(
        new Gs2Ranking2.CreateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("subscribe-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_subscribe_ranking_model_master(
        ranking2.CreateSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('subscribe-0001')
            .with_description(None)
            .with_metadata(None)
            .with_minimum_value(None)
            .with_maximum_value(None)
            .with_sum(None)
            .with_order_direction('asc')
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.create_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    name="subscribe-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.create_subscribe_ranking_model_master_async({
    namespaceName="namespace-0001",
    name="subscribe-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

```




---

### getSubscribeRankingModelMaster

購読ランキングモデルマスターを取得<br>

指定された購読ランキングモデルマスターを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingModelMaster](#subscriberankingmodelmaster) | 購読ランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingModelMaster(
    &ranking2.GetSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("subscribe-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingModelMaster(
        (new GetSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("subscribe-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.GetSubscribeRankingModelMasterResult;

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

try {
    GetSubscribeRankingModelMasterResult result = client.getSubscribeRankingModelMaster(
        new GetSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.GetSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("subscribe-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingModelMaster(
        new Gs2Ranking2.GetSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_model_master(
        ranking2.GetSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('subscribe-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.get_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="subscribe-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('ranking2')

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

```




---

### updateSubscribeRankingModelMaster

購読ランキングモデルマスターを更新<br>

指定された購読ランキングモデルマスターのスコア範囲、ソート順、合計モード、エントリー/アクセス期間イベント設定を更新します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| rankingName | string |  | ✓|  |  ~ 128文字 | 購読ランキングモデル名<br>購読ランキングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 1024文字 | メタデータ<br>メタデータには任意の値を設定できます。<br>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| minimumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最小値<br>許容されるスコアの最小値です。この値を下回るスコアは登録時に拒否されます。 |
| maximumValue | long |  | |  | 0 ~ 9223372036854775805 | スコアの最大値<br>許容されるスコアの最大値です。この値を超えるスコアは登録時に拒否されます。 |
| sum | bool |  | | false |  | スコア合算<br>有効にすると、登録されたすべてのスコアが合算され、合計値でランキングが決定されます。無効の場合、最良のスコアのみがランキングに使用されます。 |
| orderDirection | 文字列列挙型<br>enum {<br>&nbsp;&nbsp;"asc",<br>&nbsp;&nbsp;"desc"<br>}<br> |  | ✓|  |  | ソート方向<br>ランキングスコアのソート方向です。低いスコアほど上位の場合は「昇順」、高いスコアほど上位の場合は「降順」を使用します。"asc": 昇順 / "desc": 降順 /  |
| entryPeriodEventId | string |  | |  |  ~ 1024文字 | スコア登録可能期間イベントGRN<br>スコアを登録できる期間を定義する GS2-Schedule のイベントGRNです。繰り返しイベントと関連づけると、シーズン制ランキングを実現できます。 |
| accessPeriodEventId | string |  | |  |  ~ 1024文字 | ランキングデータアクセス可能期間イベントGRN<br>ランキング結果の閲覧が可能な期間を定義する GS2-Schedule のイベントGRNです。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingModelMaster](#subscriberankingmodelmaster) | 更新した購読ランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateSubscribeRankingModelMaster(
    &ranking2.UpdateSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("subscribe-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("CATEGORY_0001"),
        MinimumValue: pointy.Int64(100),
        MaximumValue: pointy.Int64(10000),
        Sum: nil,
        OrderDirection: pointy.String("desc"),
        EntryPeriodEventId: nil,
        AccessPeriodEventId: 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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateSubscribeRankingModelMaster(
        (new UpdateSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("subscribe-0001")
            ->withDescription("description1")
            ->withMetadata("CATEGORY_0001")
            ->withMinimumValue(100)
            ->withMaximumValue(10000)
            ->withSum(null)
            ->withOrderDirection("desc")
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.UpdateSubscribeRankingModelMasterResult;

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

try {
    UpdateSubscribeRankingModelMasterResult result = client.updateSubscribeRankingModelMaster(
        new UpdateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100L)
            .withMaximumValue(10000L)
            .withSum(null)
            .withOrderDirection("desc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.UpdateSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.UpdateSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("subscribe-0001")
        .WithDescription("description1")
        .WithMetadata("CATEGORY_0001")
        .WithMinimumValue(100L)
        .WithMaximumValue(10000L)
        .WithSum(null)
        .WithOrderDirection("desc")
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateSubscribeRankingModelMaster(
        new Gs2Ranking2.UpdateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100)
            .withMaximumValue(10000)
            .withSum(null)
            .withOrderDirection("desc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_subscribe_ranking_model_master(
        ranking2.UpdateSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('subscribe-0001')
            .with_description('description1')
            .with_metadata('CATEGORY_0001')
            .with_minimum_value(100)
            .with_maximum_value(10000)
            .with_sum(None)
            .with_order_direction('desc')
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.update_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="subscribe-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.update_subscribe_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="subscribe-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

```




---

### deleteSubscribeRankingModelMaster

購読ランキングモデルマスターを削除<br>

指定された購読ランキングモデルマスターを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SubscribeRankingModelMaster](#subscriberankingmodelmaster) | 削除した購読ランキングモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribeRankingModelMaster(
    &ranking2.DeleteSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("subscribe-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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribeRankingModelMaster(
        (new DeleteSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("subscribe-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.DeleteSubscribeRankingModelMasterResult;

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

try {
    DeleteSubscribeRankingModelMasterResult result = client.deleteSubscribeRankingModelMaster(
        new DeleteSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.DeleteSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("subscribe-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribeRankingModelMaster(
        new Gs2Ranking2.DeleteSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe_ranking_model_master(
        ranking2.DeleteSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('subscribe-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('ranking2')

api_result = client.delete_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="subscribe-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('ranking2')

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

```




---



