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

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

各種プログラミング言語向け GS2-SeasonRating 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>投票用紙の発行、投票の提出、レーティング計算などのシーズンレーティング操作のログ出力設定。<br/>設定した場合、操作ログが指定した GS2-Log ネームスペースに出力されます。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br/>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br/>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

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




---

### TransactionSetting

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

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



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

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


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




---

### ScriptSetting

スクリプト設定<br>

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

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

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

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



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



---

### 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" であれば 必須 |

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




---

### MatchSession

マッチセッション<br>

対戦ごとの投票コンテキストを管理する一時的なエンティティです。<br>
プレイヤーは MatchSession から投票用紙を取得し、投票結果を確定させます。<br>
TTL（有効期限）を持ち、期限経過または多数決成立により結果が確定します。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| sessionId | string |  | ※ |  |  ~ 1024文字 | セッションGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ | UUID |  ~ 128文字 | セッション名<br>セッション固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br/>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeMatchSessions - マッチセッションの一覧を取得
createMatchSession - セッションを作成
getMatchSession - セッションを取得
deleteMatchSession - セッションを削除




---

### Ballot

投票用紙<br>

特定のマッチセッションに対して各プレイヤーに発行される投票チケットです。<br>
対戦コンテキスト（シーズン、セッション、参加人数）とプレイヤーのユーザーIDを含みます。<br>
投票用紙はサーバーによって署名されプレイヤーに返却され、プレイヤーはゲーム結果を記入して WrittenBallot として再提出します。<br>
投票集計時、全参加者の投票用紙が多数決で比較され、結果の改ざんを防止します。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |
| seasonName | string |  | ✓ |  |  ~ 128文字 | シーズン名<br>この対戦のレーティング計算に使用するシーズンモデルの名前。<br/>この対戦に適用されるティアー構造とポイント変動ルールを定義する SeasonModel を参照します。 |
| sessionName | string |  | ✓ |  |  ~ 128文字 | セッション名<br>この投票用紙が属するマッチセッションの名前。<br/>同一セッション内の全投票用紙は投票プロセスにおいて集約されます。 |
| numberOfPlayer | int |  | ✓ |  | 2 ~ 10 | 参加人数<br>この対戦の総参加者数。<br/>投票の完了判定に使用されます。結果確定には全投票用紙の収集（または多数決の成立）が必要です。<br/>有効範囲: 2〜10。 |

**関連するメソッド:**
getBallot - 署名と共に投票用紙を作成
getBallotByUserId - ユーザーIDを指定して署名と共に投票用紙を作成
vote - 対戦結果を投票
voteMultiple - 対戦結果をまとめて投票


**関連するモデル:**
WrittenBallot - 記入済み投票用紙




---

### Vote

投票状況<br>

シーズン内の特定マッチセッションの投票状態を集約するモデルです。<br>
全参加者から WrittenBallot を収集し、多数決により公式な対戦結果を決定します。<br>
提出された投票用紙の数が予定参加人数に達すると投票完了と判定されます。<br>
過半数の投票用紙が結果に合意した場合に結果が確定し、合意に至らない場合は "minority" エラーが発生します。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| voteId | string |  | ※ |  |  ~ 1024文字 | 投票状況GRN<br>※ サーバーが自動で設定 |
| seasonName | string |  | ✓ |  |  ~ 128文字 | シーズン名<br>この投票に関連付けられたシーズンモデルの名前。<br/>この対戦のティアー構造とポイント変動ルールを定義する SeasonModel を参照します。 |
| sessionName | string |  | ✓ |  |  ~ 128文字 | セッション名<br>この投票が属するマッチセッションの名前。<br/>シーズン名と組み合わせて、ネームスペース内で投票を一意に識別します。 |
| writtenBallots | [List&lt;WrittenBallot&gt;](#writtenballot) |  |  | [] | 0 ~ 10 items | 記入済み投票用紙のリスト<br>対戦参加者から提出された投票用紙のコレクション。<br/>各投票用紙はプレイヤーが結果を提出するたびにユーザーIDで追加または置換されます。全予定プレイヤーが提出完了（またはセッション期限切れ）すると、<br/>多数決により投票用紙が集計され公式な対戦結果が決定されます。<br/>最大10エントリ（対戦あたりの最大参加人数に対応）。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br/>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br/>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |



---

### SeasonModel

シーズンモデル<br>

シーズン期間中に適用されるティアー構造とポイント変動ルールを定義するマスターデータです。<br>
各ティアーごとのポイント変動範囲・参加料・ランクアップボーナスを設定し、ポイント管理に使用する Experience モデルを指定します。<br>
実際のポイントおよびティアーのユーザーデータは GS2-Experience によって管理されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| seasonModelId | string |  | ※ |  |  ~ 1024文字 | シーズンモデルGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | シーズンモデル名<br>シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| metadata | string |  |  |  |  ~ 128文字 | メタデータ<br>メタデータには任意の値を設定できます。<br/>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| tiers | [List&lt;TierModel&gt;](#tiermodel) |  | ✓ |  | 1 ~ 100 items | ティアーモデルのリスト<br>シーズンのランキングラダーを構成するティアー定義の順序付きリスト。<br/>各ティアーは独自のポイント変動ルール（参加料、最小/最大変動量、昇格ボーナス）を定義します。<br/>プレイヤーは GS2-Experience で管理される累積ポイントに基づいてティアーを進行します。<br/>最小1ティアー、最大100ティアー。 |
| experienceModelId | string |  | ✓ |  |  ~ 1024文字 | 経験値モデルID<br>シーズンポイントとティアー進行の管理に使用する GS2-Experience 経験値モデルの GRN。<br/>経験値モデルのランク閾値がティアー境界を決定し、経験値がプレイヤーの現在のシーズンポイントを表します。<br/>対戦結果によるポイント変動はこの経験値モデルに適用されます。 |
| challengePeriodEventId | string |  |  |  |  ~ 1024文字 | チャレンジ期間イベントID<br>シーズンが対戦可能な期間を定義する GS2-Schedule イベントの GRN。<br/>設定した場合、参照先のイベントがアクティブな間のみプレイヤーは対戦に参加できます。<br/>未設定の場合、シーズンに期間制限はありません。 |

**関連するメソッド:**
describeSeasonModels - シーズンモデルの一覧を取得
getSeasonModel - シーズンモデルを取得




---

### TierModel

ティアーモデル<br>

ティアーモデルは、シーズン内の各ティアーにおけるポイント変動ルールを定義するモデルです。<br>
順位に応じたポイント変動範囲、参加料、昇格時ボーナスを設定します。<br>
ポイントの実データは GS2-Experience によって管理されますが、その増減ロジックは TierModel の設定に基づいて決定されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| metadata | string |  |  |  |  ~ 128文字 | メタデータ<br>メタデータには任意の値を設定できます。<br/>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| raiseRankBonus | int |  | ✓ |  | 0 ~ 10000 | ランク昇格ボーナス<br>プレイヤーがこのティアーに昇格した際に加算されるボーナスポイントで、即座の降格を防ぐバッファとして機能します。<br/>例えば 100 に設定すると、昇格閾値より100ポイント多い状態で新ティアーを開始します。<br/>有効範囲: 0〜10000。 |
| entryFee | int |  | ✓ |  | 0 ~ 10000 | 参加料<br>対戦開始前にプレイヤーから差し引かれる参加コストとしてのポイント。<br/>この参加料は対戦結果に関わらず常に減算され、対戦プレイにリスク要素を生み出します。<br/>有効範囲: 0〜10000。 |
| minimumChangePoint | int |  | ✓ |  | -99999999 ~ -1 | 最小変動ポイント<br>1回の対戦結果で発生しうる最小（最も負の）ポイント変動量で、通常は最悪の敗北時の値を表します。<br/>負の値である必要があります。敗北プレイヤーの実際のポイント変動はこの値と0の間になります。<br/>有効範囲: -99999999〜-1。 |
| maximumChangePoint | int |  | ✓ |  | 1 ~ 99999999 | 最大変動ポイント<br>1回の対戦結果で発生しうる最大（最も正の）ポイント変動量で、通常は最高の勝利時の値を表します。<br/>正の値である必要があります。勝利プレイヤーの実際のポイント変動は0とこの値の間になります。<br/>有効範囲: 1〜99999999。 |

**関連するモデル:**
SeasonModel - シーズンモデル
SeasonModelMaster - シーズンモデルマスター




---

### 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 |  | トランザクション実行中にエラーが発生したかどうか |



---

### GameResult

対戦結果<br>

対戦における1人のプレイヤーの結果を表すモデルです。<br>
プレイヤーのユーザーIDと順位を保持します。WrittenBallot 内で全参加者の結果を報告するために使用されます。<br>
投票集計時、全投票用紙のゲーム結果が多数決で比較され、公式な結果が決定されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| rank | int |  | ✓ |  | 0 ~ 2147483646 | 順位<br>対戦におけるこのプレイヤーの最終順位。<br/>1 は1位（勝者）を表します。順位の値は TierModel の設定に基づいてポイント変動量を決定するために使用されます。 |
| userId | string |  | ✓ |  |  ~ 128文字 | ユーザーID |

**関連するモデル:**
WrittenBallot - 記入済み投票用紙




---

### SignedBallot

署名付き投票用紙<br>

GS2-Key を使用してサーバーが暗号署名した投票用紙です。<br>
署名により、投票用紙の内容（シーズン、セッション、プレイヤー、参加人数）が改ざんされていないことが保証されます。<br>
投票提出時、サーバー側で署名付き投票用紙が検証された後にゲーム結果が受理されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| body | string |  | ✓ |  |  ~ 1024文字 | 署名対象データ<br>署名対象となる投票用紙データのシリアライズされたJSON表現。<br/>投票用紙の内容（ユーザーID、シーズン名、セッション名、参加人数）を署名と照合可能な形式で含みます。<br/>最大1024文字。 |
| signature | string |  | ✓ |  |  ~ 256文字 | 署名<br>投票用紙の本文に対して GS2-Key が生成した暗号署名。<br/>投票用紙がサーバーによって発行され、クライアントによって改変されていないことを検証するために使用されます。<br/>Base64エンコード、最大256文字。 |



---

### WrittenBallot

記入済み投票用紙<br>

対戦結果を書き込んだ投票用紙を表すデータモデルです。<br>
ユーザーIDと順位を含む投票内容を保持し、署名付きで Vote API に渡されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| ballot | [Ballot](#ballot) |  | ✓ |  |  | 投票用紙<br>この対戦でプレイヤーに発行された元の投票用紙。<br/>対戦コンテキスト（シーズン、セッション、プレイヤーID、参加人数）を含み、集計時に投票者を識別するために使用されます。 |
| gameResults | [List&lt;GameResult&gt;](#gameresult) |  |  |  | 0 ~ 10 items | 対戦結果のリスト<br>このプレイヤーが報告したゲーム結果で、対戦の各参加者につき1エントリ。<br/>各エントリにはユーザーIDと順位が含まれます。リスト内のユーザーIDは一意でなければなりません（child_unique制約により強制）。<br/>投票集計時、結果はユーザーIDでソートされ、全提出投票用紙間で比較して多数決を取ります。<br/>最大10エントリ。 |

**関連するモデル:**
Vote - 投票状況




---

### CurrentSeasonModelMaster

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

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

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



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

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




---

### SeasonModelMaster

シーズンモデルマスター<br>

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

シーズンモデルは、シーズン期間中に適用されるティアー構造とポイント変動ルールを定義するマスターデータです。<br>
各ティアーの変動範囲・参加料・ランクアップボーナスを設定し、ポイント管理に使用する Experience モデルを指定します。<br>
実際のポイントおよびティアーのユーザーデータは GS2-Experience によって管理されます。



|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| seasonModelId | string |  | ※ |  |  ~ 1024文字 | シーズンモデルマスターGRN<br>※ サーバーが自動で設定 |
| name | string |  | ✓ |  |  ~ 128文字 | シーズンモデル名<br>シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| metadata | string |  |  |  |  ~ 128文字 | メタデータ<br>メタデータには任意の値を設定できます。<br/>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| description | string |  |  |  |  ~ 1024文字 | 説明文 |
| tiers | [List&lt;TierModel&gt;](#tiermodel) |  | ✓ |  | 1 ~ 100 items | ティアーモデルのリスト<br>シーズンのランキングラダーを構成するティアー定義の順序付きリスト。<br/>各ティアーは独自のポイント変動ルール（参加料、最小/最大変動量、昇格ボーナス）を定義します。<br/>プレイヤーは GS2-Experience で管理される累積ポイントに基づいてティアーを進行します。<br/>最小1ティアー、最大100ティアー。 |
| experienceModelId | string |  | ✓ |  |  ~ 1024文字 | 経験値モデルID<br>シーズンポイントとティアー進行の管理に使用する GS2-Experience 経験値モデルの GRN。<br/>経験値モデルのランク閾値がティアー境界を決定し、経験値がプレイヤーの現在のシーズンポイントを表します。<br/>対戦結果によるポイント変動はこの経験値モデルに適用されます。 |
| challengePeriodEventId | string |  |  |  |  ~ 1024文字 | チャレンジ期間イベントID<br>シーズンが対戦可能な期間を定義する GS2-Schedule イベントの GRN。<br/>設定した場合、参照先のイベントがアクティブな間のみプレイヤーは対戦に参加できます。<br/>未設定の場合、シーズンに期間制限はありません。 |
| createdAt | long |  | ※ | 現在時刻 |  | 作成日時<br>UNIX 時間・ミリ秒<br/>※ サーバーが自動で設定 |
| updatedAt | long |  | ※ | 現在時刻 |  | 最終更新日時<br>UNIX 時間・ミリ秒<br/>※ サーバーが自動で設定 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | リビジョン |

**関連するメソッド:**
describeSeasonModelMasters - シーズンモデルマスターの一覧を取得
createSeasonModelMaster - シーズンモデルマスターを新規作成
getSeasonModelMaster - シーズンモデルマスターを取得
updateSeasonModelMaster - シーズンモデルマスターを更新
deleteSeasonModelMaster - シーズンモデルマスターを削除




---
## メソッド

### 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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DescribeNamespacesRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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>投票用紙の発行、投票の提出、レーティング計算などのシーズンレーティング操作のログ出力設定。<br/>設定した場合、操作ログが指定した GS2-Log ネームスペースに出力されます。 |

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &season_rating.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        LogSetting: &seasonRating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetNamespaceStatusRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetNamespaceRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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>投票用紙の発行、投票の提出、レーティング計算などのシーズンレーティング操作のログ出力設定。<br/>設定した場合、操作ログが指定した GS2-Log ネームスペースに出力されます。 |

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &season_rating.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        LogSetting: &seasonRating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DeleteNamespaceRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetServiceVersionRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DumpUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CleanUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\ImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

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

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

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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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;

```




---

### describeMatchSessions

マッチセッションの一覧を取得<br>

ネームスペース内のマッチセッションのページネーション付きリストを取得します。マッチセッションは個々の対戦を表し、レーティング計算のためにプレイヤーをグループ化するために使用されます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;MatchSession&gt;](#matchsession) | セッションのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DescribeMatchSessions(
    &season_rating.DescribeMatchSessionsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DescribeMatchSessionsRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->describeMatchSessions(
        (new DescribeMatchSessionsRequest())
            ->withNamespaceName("namespace-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DescribeMatchSessionsRequest;
import io.gs2.seasonRating.result.DescribeMatchSessionsResult;

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

try {
    DescribeMatchSessionsResult result = client.describeMatchSessions(
        new DescribeMatchSessionsRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<MatchSession> 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeMatchSessionsResult> asyncResult = null;
yield return client.DescribeMatchSessions(
    new Gs2.Gs2SeasonRating.Request.DescribeMatchSessionsRequest()
        .WithNamespaceName("namespace-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.describeMatchSessions(
        new Gs2SeasonRating.DescribeMatchSessionsRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.describe_match_sessions(
        season_rating.DescribeMatchSessionsRequest()
            .with_namespace_name('namespace-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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

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

```

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

client = gs2('season_rating')

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

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

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

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

```




---

### createMatchSession

セッションを作成<br>

セッションを作成すると、セッションIDが発行されます。<br>
対戦結果のレポート送信にはセッションIDが必要で、セッションIDを指定してレポートを送信することで、そのセッションに対するレポートを送信することができます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [MatchSession](#matchsession) | 作成したセッション |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CreateMatchSession(
    &season_rating.CreateMatchSessionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SessionName: pointy.String("matchSession-0001"),
        TtlSeconds: 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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CreateMatchSessionRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->createMatchSession(
        (new CreateMatchSessionRequest())
            ->withNamespaceName("namespace-0001")
            ->withSessionName("matchSession-0001")
            ->withTtlSeconds(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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.CreateMatchSessionRequest;
import io.gs2.seasonRating.result.CreateMatchSessionResult;

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

try {
    CreateMatchSessionResult result = client.createMatchSession(
        new CreateMatchSessionRequest()
            .withNamespaceName("namespace-0001")
            .withSessionName("matchSession-0001")
            .withTtlSeconds(null)
    );
    MatchSession 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.CreateMatchSessionResult> asyncResult = null;
yield return client.CreateMatchSession(
    new Gs2.Gs2SeasonRating.Request.CreateMatchSessionRequest()
        .WithNamespaceName("namespace-0001")
        .WithSessionName("matchSession-0001")
        .WithTtlSeconds(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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.createMatchSession(
        new Gs2SeasonRating.CreateMatchSessionRequest()
            .withNamespaceName("namespace-0001")
            .withSessionName("matchSession-0001")
            .withTtlSeconds(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.create_match_session(
        season_rating.CreateMatchSessionRequest()
            .with_namespace_name('namespace-0001')
            .with_session_name('matchSession-0001')
            .with_ttl_seconds(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.create_match_session({
    namespaceName="namespace-0001",
    sessionName="matchSession-0001",
    ttlSeconds=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('season_rating')

api_result_handler = client.create_match_session_async({
    namespaceName="namespace-0001",
    sessionName="matchSession-0001",
    ttlSeconds=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;

```




---

### getMatchSession

セッションを取得<br>

名前とTTL情報を含む、指定されたマッチセッションを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [MatchSession](#matchsession) | セッション |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetMatchSession(
    &season_rating.GetMatchSessionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SessionName: pointy.String("matchSession-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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetMatchSessionRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->getMatchSession(
        (new GetMatchSessionRequest())
            ->withNamespaceName("namespace-0001")
            ->withSessionName("matchSession-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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetMatchSessionRequest;
import io.gs2.seasonRating.result.GetMatchSessionResult;

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

try {
    GetMatchSessionResult result = client.getMatchSession(
        new GetMatchSessionRequest()
            .withNamespaceName("namespace-0001")
            .withSessionName("matchSession-0001")
    );
    MatchSession 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.GetMatchSessionResult> asyncResult = null;
yield return client.GetMatchSession(
    new Gs2.Gs2SeasonRating.Request.GetMatchSessionRequest()
        .WithNamespaceName("namespace-0001")
        .WithSessionName("matchSession-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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getMatchSession(
        new Gs2SeasonRating.GetMatchSessionRequest()
            .withNamespaceName("namespace-0001")
            .withSessionName("matchSession-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_match_session(
        season_rating.GetMatchSessionRequest()
            .with_namespace_name('namespace-0001')
            .with_session_name('matchSession-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.get_match_session({
    namespaceName="namespace-0001",
    sessionName="matchSession-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('season_rating')

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

```




---

### deleteMatchSession

セッションを削除<br>

指定されたマッチセッションを削除します。セッションに関連する保留中の投票も無効化されます。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [MatchSession](#matchsession) | 削除したセッション |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DeleteMatchSession(
    &season_rating.DeleteMatchSessionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SessionName: pointy.String("matchSession-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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DeleteMatchSessionRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->deleteMatchSession(
        (new DeleteMatchSessionRequest())
            ->withNamespaceName("namespace-0001")
            ->withSessionName("matchSession-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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DeleteMatchSessionRequest;
import io.gs2.seasonRating.result.DeleteMatchSessionResult;

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

try {
    DeleteMatchSessionResult result = client.deleteMatchSession(
        new DeleteMatchSessionRequest()
            .withNamespaceName("namespace-0001")
            .withSessionName("matchSession-0001")
    );
    MatchSession 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.DeleteMatchSessionResult> asyncResult = null;
yield return client.DeleteMatchSession(
    new Gs2.Gs2SeasonRating.Request.DeleteMatchSessionRequest()
        .WithNamespaceName("namespace-0001")
        .WithSessionName("matchSession-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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.deleteMatchSession(
        new Gs2SeasonRating.DeleteMatchSessionRequest()
            .withNamespaceName("namespace-0001")
            .withSessionName("matchSession-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.delete_match_session(
        season_rating.DeleteMatchSessionRequest()
            .with_namespace_name('namespace-0001')
            .with_session_name('matchSession-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.delete_match_session({
    namespaceName="namespace-0001",
    sessionName="matchSession-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('season_rating')

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

```




---

### getBallot

署名と共に投票用紙を作成<br>

マッチセッションのレーティング投票に参加するため、リクエストしたユーザーの投票用紙を発行します。プレイヤーがシーズンの挑戦期間内であることを検証し、設定されたエントリー料をプレイヤーのレーティングから差し引き、指定された暗号鍵を使用して署名付き投票用紙を生成します。署名付き投票用紙は vote または voteMultiple の送信時に使用されます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| seasonName | string |  | ✓|  |  ~ 128文字 | シーズンモデル名<br>シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| sessionName | string |  | ✓| UUID |  ~ 128文字 | セッション名<br>セッション固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| accessToken | string |  | ✓|  |  ~ 128文字 | アクセストークン |
| numberOfPlayer | int |  | ✓|  | 2 ~ 10 | 参加人数 |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024文字 | 暗号鍵GRN |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Ballot](#ballot) | 投票用紙 |
| body | string | 署名対象のデータ |
| signature | string | 署名データ |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetBallot(
    &season_rating.GetBallotRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        SessionName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetBallotRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->getBallot(
        (new GetBallotRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSessionName("gathering-0001")
            ->withAccessToken("accessToken-0001")
            ->withNumberOfPlayer(4)
            ->withKeyId("key-0001")
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetBallotRequest;
import io.gs2.seasonRating.result.GetBallotResult;

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

try {
    GetBallotResult result = client.getBallot(
        new GetBallotRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSessionName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.GetBallotResult> asyncResult = null;
yield return client.GetBallot(
    new Gs2.Gs2SeasonRating.Request.GetBallotRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSessionName("gathering-0001")
        .WithAccessToken("accessToken-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getBallot(
        new Gs2SeasonRating.GetBallotRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSessionName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_ballot(
        season_rating.GetBallotRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_session_name('gathering-0001')
            .with_access_token('accessToken-0001')
            .with_number_of_player(4)
            .with_key_id('key-0001')
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.get_ballot({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    sessionName="gathering-0001",
    accessToken="accessToken-0001",
    numberOfPlayer=4,
    keyId="key-0001",
})

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

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

```

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

client = gs2('season_rating')

api_result_handler = client.get_ballot_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    sessionName="gathering-0001",
    accessToken="accessToken-0001",
    numberOfPlayer=4,
    keyId="key-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;
body = result.body;
signature = result.signature;

```




---

### getBallotByUserId

ユーザーIDを指定して署名と共に投票用紙を作成<br>

指定したユーザーがマッチセッションのレーティング投票に参加するための投票用紙を発行します。挑戦期間の検証、エントリー料の差し引き、指定された暗号鍵を使用した署名付き投票用紙の生成を行います。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| seasonName | string |  | ✓|  |  ~ 128文字 | シーズンモデル名<br>シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| sessionName | string |  | ✓| UUID |  ~ 128文字 | セッション名<br>セッション固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| userId | string |  | ✓|  |  ~ 128文字 | ユーザーID |
| numberOfPlayer | int |  | ✓|  | 2 ~ 10 | 参加人数 |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024文字 | 暗号鍵GRN |
| timeOffsetToken | string |  | |  |  ~ 1024文字 | タイムオフセットトークン |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Ballot](#ballot) | 投票用紙 |
| body | string | 署名対象のデータ |
| signature | string | 署名データ |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetBallotByUserId(
    &season_rating.GetBallotByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        SessionName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("key-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetBallotByUserIdRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->getBallotByUserId(
        (new GetBallotByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSessionName("gathering-0001")
            ->withUserId("user-0001")
            ->withNumberOfPlayer(4)
            ->withKeyId("key-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetBallotByUserIdRequest;
import io.gs2.seasonRating.result.GetBallotByUserIdResult;

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

try {
    GetBallotByUserIdResult result = client.getBallotByUserId(
        new GetBallotByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSessionName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.GetBallotByUserIdResult> asyncResult = null;
yield return client.GetBallotByUserId(
    new Gs2.Gs2SeasonRating.Request.GetBallotByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSessionName("gathering-0001")
        .WithUserId("user-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("key-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getBallotByUserId(
        new Gs2SeasonRating.GetBallotByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSessionName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_ballot_by_user_id(
        season_rating.GetBallotByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_session_name('gathering-0001')
            .with_user_id('user-0001')
            .with_number_of_player(4)
            .with_key_id('key-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.get_ballot_by_user_id({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    sessionName="gathering-0001",
    userId="user-0001",
    numberOfPlayer=4,
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

```

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

client = gs2('season_rating')

api_result_handler = client.get_ballot_by_user_id_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    sessionName="gathering-0001",
    userId="user-0001",
    numberOfPlayer=4,
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

```




---

### vote

対戦結果を投票<br>

投票は最初の投票が行われてから5分以内に行う必要があります。<br>
つまり、結果は即座に反映されず、投票開始からおよそ5分後または全てのプレイヤーが投票を行った際に結果が反映されます。<br>
5分以内に全ての投票用紙を回収できなかった場合はその時点の投票内容で多数決をとって結果を決定します。<br>

結果を即座に反映したい場合は、勝利した側の代表プレイヤーが投票用紙を各プレイヤーから集めて voteMultiple を呼び出すことで結果を即座に反映できます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| ballotBody | string |  | ✓|  |  ~ 1024文字 | 投票用紙の署名対象のデータ |
| ballotSignature | string |  | ✓|  |  ~ 256文字 | 投票用紙の署名 |
| gameResults | [List&lt;GameResult&gt;](#gameresult) |  | |  | 0 ~ 10 items | 対戦結果<br>対戦を行ったプレイヤーグループに所属するユーザーIDのリスト |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024文字 | 暗号鍵GRN |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Ballot](#ballot) | 投票用紙 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.Vote(
    &season_rating.VoteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        BallotBody: pointy.String("ballotBody..."),
        BallotSignature: pointy.String("ballotSignature..."),
        GameResults: []seasonRating.GameResult{
            seasonRating.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\VoteRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->vote(
        (new VoteRequest())
            ->withNamespaceName("namespace-0001")
            ->withBallotBody("ballotBody...")
            ->withBallotSignature("ballotSignature...")
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
            ->withKeyId("key-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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.VoteRequest;
import io.gs2.seasonRating.result.VoteResult;

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

try {
    VoteResult result = client.vote(
        new VoteRequest()
            .withNamespaceName("namespace-0001")
            .withBallotBody("ballotBody...")
            .withBallotSignature("ballotSignature...")
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.VoteResult> asyncResult = null;
yield return client.Vote(
    new Gs2.Gs2SeasonRating.Request.VoteRequest()
        .WithNamespaceName("namespace-0001")
        .WithBallotBody("ballotBody...")
        .WithBallotSignature("ballotSignature...")
        .WithGameResults(new Gs2.Gs2SeasonRating.Model.GameResult[] {
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.vote(
        new Gs2SeasonRating.VoteRequest()
            .withNamespaceName("namespace-0001")
            .withBallotBody("ballotBody...")
            .withBallotSignature("ballotSignature...")
            .withGameResults([
                new Gs2SeasonRating.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.vote(
        season_rating.VoteRequest()
            .with_namespace_name('namespace-0001')
            .with_ballot_body('ballotBody...')
            .with_ballot_signature('ballotSignature...')
            .with_game_results([
                season_rating.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                season_rating.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                season_rating.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                season_rating.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
            .with_key_id('key-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.vote({
    namespaceName="namespace-0001",
    ballotBody="ballotBody...",
    ballotSignature="ballotSignature...",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-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('season_rating')

api_result_handler = client.vote_async({
    namespaceName="namespace-0001",
    ballotBody="ballotBody...",
    ballotSignature="ballotSignature...",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-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;

```




---

### voteMultiple

対戦結果をまとめて投票<br>

ゲームに勝利した側が他プレイヤーの投票用紙を集めてまとめて投票するのに使用します。<br>
『勝利した側』としているのは、敗北した側が自分たちが勝ったことにして報告することにインセンティブはありますが、その逆はないためです。<br>
負けた側が投票用紙を渡してこない可能性がありますが、その場合も過半数の投票用紙があれば結果を通すことができます。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| signedBallots | [List&lt;SignedBallot&gt;](#signedballot) |  | |  | 0 ~ 10 items | 署名付の投票用紙リスト |
| gameResults | [List&lt;GameResult&gt;](#gameresult) |  | |  | 0 ~ 10 items | 投票内容。対戦を行ったプレイヤーグループ1に所属するユーザーIDのリスト |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024文字 | 暗号鍵GRN |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [Ballot](#ballot) | 投票用紙 |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.VoteMultiple(
    &season_rating.VoteMultipleRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SignedBallots: []seasonRating.SignedBallot{
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
        },
        GameResults: []seasonRating.GameResult{
            seasonRating.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\VoteMultipleRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->voteMultiple(
        (new VoteMultipleRequest())
            ->withNamespaceName("namespace-0001")
            ->withSignedBallots([
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
            ])
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
            ->withKeyId("key-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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.VoteMultipleRequest;
import io.gs2.seasonRating.result.VoteMultipleResult;

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

try {
    VoteMultipleResult result = client.voteMultiple(
        new VoteMultipleRequest()
            .withNamespaceName("namespace-0001")
            .withSignedBallots(Arrays.asList(
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb")
            ))
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.VoteMultipleResult> asyncResult = null;
yield return client.VoteMultiple(
    new Gs2.Gs2SeasonRating.Request.VoteMultipleRequest()
        .WithNamespaceName("namespace-0001")
        .WithSignedBallots(new Gs2.Gs2SeasonRating.Model.SignedBallot[] {
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
        })
        .WithGameResults(new Gs2.Gs2SeasonRating.Model.GameResult[] {
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.voteMultiple(
        new Gs2SeasonRating.VoteMultipleRequest()
            .withNamespaceName("namespace-0001")
            .withSignedBallots([
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
            ])
            .withGameResults([
                new Gs2SeasonRating.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.vote_multiple(
        season_rating.VoteMultipleRequest()
            .with_namespace_name('namespace-0001')
            .with_signed_ballots([
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
            ])
            .with_game_results([
                season_rating.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                season_rating.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                season_rating.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                season_rating.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
            .with_key_id('key-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.vote_multiple({
    namespaceName="namespace-0001",
    signedBallots={
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        }
    },
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-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('season_rating')

api_result_handler = client.vote_multiple_async({
    namespaceName="namespace-0001",
    signedBallots={
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        }
    },
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-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;

```




---

### commitVote

投票状況を強制確定<br>

すべての投票が集まるのを待たずに、マッチセッションのレーティング計算を手動でトリガーします。保留中の投票を処理し、現在の投票状態に基づいてレーティング変更を計算し、処理後に投票レコードとマッチセッションを削除します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| seasonName | string |  | ✓|  |  ~ 128文字 | シーズンモデル名<br>シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| sessionName | string |  | ✓|  |  ~ 128文字 | セッション名<br>この投票が属するマッチセッションの名前。<br/>シーズン名と組み合わせて、ネームスペース内で投票を一意に識別します。 |

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CommitVote(
    &season_rating.CommitVoteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("rating-0001"),
        SessionName: pointy.String("gathering-0001"),
    }
)
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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CommitVoteRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->commitVote(
        (new CommitVoteRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("rating-0001")
            ->withSessionName("gathering-0001")
    );
} 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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.CommitVoteRequest;
import io.gs2.seasonRating.result.CommitVoteResult;

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

try {
    CommitVoteResult result = client.commitVote(
        new CommitVoteRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
    );
} 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.CommitVoteResult> asyncResult = null;
yield return client.CommitVote(
    new Gs2.Gs2SeasonRating.Request.CommitVoteRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("rating-0001")
        .WithSessionName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.commitVote(
        new Gs2SeasonRating.CommitVoteRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.commit_vote(
        season_rating.CommitVoteRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('rating-0001')
            .with_session_name('gathering-0001')
    )
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.commit_vote({
    namespaceName="namespace-0001",
    seasonName="rating-0001",
    sessionName="gathering-0001",
})

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

api_result_handler = client.commit_vote_async({
    namespaceName="namespace-0001",
    seasonName="rating-0001",
    sessionName="gathering-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

```




---

### describeSeasonModels

シーズンモデルの一覧を取得<br>

現在アクティブなシーズンモデルの一覧を取得します。シーズンモデルは、シーズンレーティング計算のためのレーティングティア、経験値モデル参照、挑戦期間イベントを定義します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| items | [List&lt;SeasonModel&gt;](#seasonmodel) | シーズンモデルのリスト |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DescribeSeasonModels(
    &season_rating.DescribeSeasonModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DescribeSeasonModelsRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->describeSeasonModels(
        (new DescribeSeasonModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DescribeSeasonModelsRequest;
import io.gs2.seasonRating.result.DescribeSeasonModelsResult;

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

try {
    DescribeSeasonModelsResult result = client.describeSeasonModels(
        new DescribeSeasonModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<SeasonModel> 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeSeasonModelsResult> asyncResult = null;
yield return client.DescribeSeasonModels(
    new Gs2.Gs2SeasonRating.Request.DescribeSeasonModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.describeSeasonModels(
        new Gs2SeasonRating.DescribeSeasonModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.describe_season_models(
        season_rating.DescribeSeasonModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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

result = api_result.result
items = result.items;

```

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

client = gs2('season_rating')

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

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

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

result = api_result.result
items = result.items;

```




---

### getSeasonModel

シーズンモデルを取得<br>

レーティングティア、経験値モデル参照、挑戦期間イベント設定を含む、指定されたシーズンモデルを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SeasonModel](#seasonmodel) | シーズンモデル |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetSeasonModel(
    &season_rating.GetSeasonModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("mode1"),
    }
)
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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetSeasonModelRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->getSeasonModel(
        (new GetSeasonModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("mode1")
    );
    $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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetSeasonModelRequest;
import io.gs2.seasonRating.result.GetSeasonModelResult;

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

try {
    GetSeasonModelResult result = client.getSeasonModel(
        new GetSeasonModelRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
    );
    SeasonModel 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.GetSeasonModelResult> asyncResult = null;
yield return client.GetSeasonModel(
    new Gs2.Gs2SeasonRating.Request.GetSeasonModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("mode1"),
    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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getSeasonModel(
        new Gs2SeasonRating.GetSeasonModelRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_season_model(
        season_rating.GetSeasonModelRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.get_season_model({
    namespaceName="namespace-0001",
    seasonName="mode1",
})

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

api_result_handler = client.get_season_model_async({
    namespaceName="namespace-0001",
    seasonName="mode1",
})

api_result = api_result_handler()  -- Call the handler 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 | [CurrentSeasonModelMaster](#currentseasonmodelmaster) | 有効化可能なマスターデータ |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.ExportMasterRequest;
import io.gs2.seasonRating.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentSeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2SeasonRating.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 Gs2SeasonRating from '@/gs2/seasonRating';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.export_master(
        season_rating.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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;

```




---

### getCurrentSeasonModelMaster

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

レーティング計算に使用されているすべてのシーズンレーティング定義を含む、現在アクティブなシーズンモデルマスターデータを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [CurrentSeasonModelMaster](#currentseasonmodelmaster) | 現在アクティブなシーズンモデルのマスターデータ |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetCurrentSeasonModelMaster(
    &season_rating.GetCurrentSeasonModelMasterRequest {
        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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetCurrentSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->getCurrentSeasonModelMaster(
        (new GetCurrentSeasonModelMasterRequest())
            ->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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetCurrentSeasonModelMasterRequest;
import io.gs2.seasonRating.result.GetCurrentSeasonModelMasterResult;

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

try {
    GetCurrentSeasonModelMasterResult result = client.getCurrentSeasonModelMaster(
        new GetCurrentSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentSeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.GetCurrentSeasonModelMasterResult> asyncResult = null;
yield return client.GetCurrentSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.GetCurrentSeasonModelMasterRequest()
        .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 Gs2SeasonRating from '@/gs2/seasonRating';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_current_season_model_master(
        season_rating.GetCurrentSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

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

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

result = api_result.result
item = result.item;

```

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

client = gs2('season_rating')

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

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

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

result = api_result.result
item = result.item;

```




---

### preUpdateCurrentSeasonModelMaster

現在アクティブなシーズンモデルのマスターデータを更新（3フェーズ版）<br>

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



#### 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/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentSeasonModelMaster(
    &season_rating.PreUpdateCurrentSeasonModelMasterRequest {
        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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\PreUpdateCurrentSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentSeasonModelMaster(
        (new PreUpdateCurrentSeasonModelMasterRequest())
            ->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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.PreUpdateCurrentSeasonModelMasterRequest;
import io.gs2.seasonRating.result.PreUpdateCurrentSeasonModelMasterResult;

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

try {
    PreUpdateCurrentSeasonModelMasterResult result = client.preUpdateCurrentSeasonModelMaster(
        new PreUpdateCurrentSeasonModelMasterRequest()
            .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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.PreUpdateCurrentSeasonModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.PreUpdateCurrentSeasonModelMasterRequest()
        .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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.preUpdateCurrentSeasonModelMaster(
        new Gs2SeasonRating.PreUpdateCurrentSeasonModelMasterRequest()
            .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 season_rating

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

try:
    result = client.pre_update_current_season_model_master(
        season_rating.PreUpdateCurrentSeasonModelMasterRequest()
            .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('season_rating')

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

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

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

```

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

client = gs2('season_rating')

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

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

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

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

```




---

### updateCurrentSeasonModelMaster

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

現在アクティブなシーズンモデルマスターデータを更新します。大容量マスターデータに対応するため、直接更新モードと事前アップロードモードの両方をサポートしています。事前アップロードモードでは、PreUpdate APIで取得したアップロードトークンを使用して設定を読み取ります。



#### 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 | [CurrentSeasonModelMaster](#currentseasonmodelmaster) | 更新された現在アクティブなシーズンモデルのマスターデータ |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentSeasonModelMaster(
    &season_rating.UpdateCurrentSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}"),
        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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateCurrentSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->updateCurrentSeasonModelMaster(
        (new UpdateCurrentSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
            ->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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.UpdateCurrentSeasonModelMasterRequest;
import io.gs2.seasonRating.result.UpdateCurrentSeasonModelMasterResult;

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

try {
    UpdateCurrentSeasonModelMasterResult result = client.updateCurrentSeasonModelMaster(
        new UpdateCurrentSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
            .withUploadToken(null)
    );
    CurrentSeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
        .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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.updateCurrentSeasonModelMaster(
        new Gs2SeasonRating.UpdateCurrentSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.update_current_season_model_master(
        season_rating.UpdateCurrentSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-02-23", "seasonModels": [{"name": "season1", "tiers": [{"raiseRankBonus": 0, "entryFee": 0, "minimumChangePoint": -10, "maximumChangePoint": 20}, {"raiseRankBonus": 30, "entryFee": 10, "minimumChangePoint": -10, "maximumChangePoint": 30}, {"raiseRankBonus": 60, "entryFee": 20, "minimumChangePoint": -20, "maximumChangePoint": 50}, {"raiseRankBonus": 60, "entryFee": 30, "minimumChangePoint": -30, "maximumChangePoint": 60}], "experienceModelId": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level", "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.update_current_season_model_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}",
    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('season_rating')

api_result_handler = client.update_current_season_model_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}",
    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;

```




---

### updateCurrentSeasonModelMasterFromGitHub

現在アクティブなシーズンモデルのマスターデータをGitHubから更新<br>

指定されたチェックアウト設定を使用してGitHubリポジトリからマスターデータをチェックアウトし、現在アクティブなシーズンモデルマスターデータを更新します。GitHubとの認証にはキーサービス経由でAPIキーが復号されます。



#### Request

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

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentSeasonModelMasterFromGitHub(
    &season_rating.UpdateCurrentSeasonModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &seasonRating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateCurrentSeasonModelMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->updateCurrentSeasonModelMasterFromGitHub(
        (new UpdateCurrentSeasonModelMasterFromGitHubRequest())
            ->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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.UpdateCurrentSeasonModelMasterFromGitHubRequest;
import io.gs2.seasonRating.result.UpdateCurrentSeasonModelMasterFromGitHubResult;

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

try {
    UpdateCurrentSeasonModelMasterFromGitHubResult result = client.updateCurrentSeasonModelMasterFromGitHub(
        new UpdateCurrentSeasonModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentSeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentSeasonModelMasterFromGitHub(
    new Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2SeasonRating.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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.updateCurrentSeasonModelMasterFromGitHub(
        new Gs2SeasonRating.UpdateCurrentSeasonModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2SeasonRating.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 season_rating

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

try:
    result = client.update_current_season_model_master_from_git_hub(
        season_rating.UpdateCurrentSeasonModelMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(season_rating.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('season_rating')

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

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

result = api_result.result
item = result.item;

```

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

client = gs2('season_rating')

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

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

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

result = api_result.result
item = result.item;

```




---

### describeSeasonModelMasters

シーズンモデルマスターの一覧を取得<br>

シーズンモデルマスターのページネーション付きリストを取得します。名前のプレフィックスでフィルタリングできます。シーズンモデルマスターは、シーズンレーティングのためのレーティングティア、経験値モデル参照、挑戦期間イベントを定義します。



#### Request

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

#### Result

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

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DescribeSeasonModelMasters(
    &season_rating.DescribeSeasonModelMastersRequest {
        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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DescribeSeasonModelMastersRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->describeSeasonModelMasters(
        (new DescribeSeasonModelMastersRequest())
            ->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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DescribeSeasonModelMastersRequest;
import io.gs2.seasonRating.result.DescribeSeasonModelMastersResult;

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

try {
    DescribeSeasonModelMastersResult result = client.describeSeasonModelMasters(
        new DescribeSeasonModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonModelMaster> 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeSeasonModelMastersResult> asyncResult = null;
yield return client.DescribeSeasonModelMasters(
    new Gs2.Gs2SeasonRating.Request.DescribeSeasonModelMastersRequest()
        .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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.describeSeasonModelMasters(
        new Gs2SeasonRating.DescribeSeasonModelMastersRequest()
            .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 season_rating

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

try:
    result = client.describe_season_model_masters(
        season_rating.DescribeSeasonModelMastersRequest()
            .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('season_rating')

api_result = client.describe_season_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('season_rating')

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

```




---

### createSeasonModelMaster

シーズンモデルマスターを新規作成<br>

レーティングティア、レーティング保存用のGS2-Experience経験値モデルへの参照、およびプレイヤーの参加を制限するオプションの挑戦期間イベントIDを持つ新しいシーズンモデルマスターを作成します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| name | string |  | ✓|  |  ~ 128文字 | シーズンモデル名<br>シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 128文字 | メタデータ<br>メタデータには任意の値を設定できます。<br/>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| tiers | [List&lt;TierModel&gt;](#tiermodel) |  | ✓|  | 1 ~ 100 items | ティアーモデルのリスト<br>シーズンのランキングラダーを構成するティアー定義の順序付きリスト。<br/>各ティアーは独自のポイント変動ルール（参加料、最小/最大変動量、昇格ボーナス）を定義します。<br/>プレイヤーは GS2-Experience で管理される累積ポイントに基づいてティアーを進行します。<br/>最小1ティアー、最大100ティアー。 |
| experienceModelId | string |  | ✓|  |  ~ 1024文字 | 経験値モデルID<br>シーズンポイントとティアー進行の管理に使用する GS2-Experience 経験値モデルの GRN。<br/>経験値モデルのランク閾値がティアー境界を決定し、経験値がプレイヤーの現在のシーズンポイントを表します。<br/>対戦結果によるポイント変動はこの経験値モデルに適用されます。 |
| challengePeriodEventId | string |  | |  |  ~ 1024文字 | チャレンジ期間イベントID<br>シーズンが対戦可能な期間を定義する GS2-Schedule イベントの GRN。<br/>設定した場合、参照先のイベントがアクティブな間のみプレイヤーは対戦に参加できます。<br/>未設定の場合、シーズンに期間制限はありません。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SeasonModelMaster](#seasonmodelmaster) | 作成したシーズンモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CreateSeasonModelMaster(
    &season_rating.CreateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("mode1"),
        Description: nil,
        Metadata: nil,
        Tiers: []seasonRating.TierModel{
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(0),
                EntryFee: pointy.Int32(0),
                MinimumChangePoint: pointy.Int32(-10),
                MaximumChangePoint: pointy.Int32(20),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(30),
                EntryFee: pointy.Int32(10),
                MinimumChangePoint: pointy.Int32(-10),
                MaximumChangePoint: pointy.Int32(30),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(60),
                EntryFee: pointy.Int32(20),
                MinimumChangePoint: pointy.Int32(-20),
                MaximumChangePoint: pointy.Int32(50),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(60),
                EntryFee: pointy.Int32(30),
                MinimumChangePoint: pointy.Int32(-30),
                MaximumChangePoint: pointy.Int32(60),
            },
        },
        ExperienceModelId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level"),
        ChallengePeriodEventId: 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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CreateSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->createSeasonModelMaster(
        (new CreateSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("mode1")
            ->withDescription(null)
            ->withMetadata(null)
            ->withTiers([
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(0)
                    ->withEntryFee(0)
                    ->withMinimumChangePoint(-10)
                    ->withMaximumChangePoint(20),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(30)
                    ->withEntryFee(10)
                    ->withMinimumChangePoint(-10)
                    ->withMaximumChangePoint(30),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(60)
                    ->withEntryFee(20)
                    ->withMinimumChangePoint(-20)
                    ->withMaximumChangePoint(50),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(60)
                    ->withEntryFee(30)
                    ->withMinimumChangePoint(-30)
                    ->withMaximumChangePoint(60),
            ])
            ->withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
            ->withChallengePeriodEventId(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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.CreateSeasonModelMasterRequest;
import io.gs2.seasonRating.result.CreateSeasonModelMasterResult;

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

try {
    CreateSeasonModelMasterResult result = client.createSeasonModelMaster(
        new CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withTiers(Arrays.asList(
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(20),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(30)
                    .withEntryFee(10)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(30),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(20)
                    .withMinimumChangePoint(-20)
                    .withMaximumChangePoint(50),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(30)
                    .withMinimumChangePoint(-30)
                    .withMaximumChangePoint(60)
            ))
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
            .withChallengePeriodEventId(null)
    );
    SeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.CreateSeasonModelMasterResult> asyncResult = null;
yield return client.CreateSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.CreateSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("mode1")
        .WithDescription(null)
        .WithMetadata(null)
        .WithTiers(new Gs2.Gs2SeasonRating.Model.TierModel[] {
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(0)
                .WithEntryFee(0)
                .WithMinimumChangePoint(-10)
                .WithMaximumChangePoint(20),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(30)
                .WithEntryFee(10)
                .WithMinimumChangePoint(-10)
                .WithMaximumChangePoint(30),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(60)
                .WithEntryFee(20)
                .WithMinimumChangePoint(-20)
                .WithMaximumChangePoint(50),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(60)
                .WithEntryFee(30)
                .WithMinimumChangePoint(-30)
                .WithMaximumChangePoint(60),
        })
        .WithExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
        .WithChallengePeriodEventId(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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.createSeasonModelMaster(
        new Gs2SeasonRating.CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withTiers([
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(20),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(30)
                    .withEntryFee(10)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(30),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(20)
                    .withMinimumChangePoint(-20)
                    .withMaximumChangePoint(50),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(30)
                    .withMinimumChangePoint(-30)
                    .withMaximumChangePoint(60),
            ])
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
            .withChallengePeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.create_season_model_master(
        season_rating.CreateSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('mode1')
            .with_description(None)
            .with_metadata(None)
            .with_tiers([
                season_rating.TierModel()
                    .with_raise_rank_bonus(0)
                    .with_entry_fee(0)
                    .with_minimum_change_point(-10)
                    .with_maximum_change_point(20),
                season_rating.TierModel()
                    .with_raise_rank_bonus(30)
                    .with_entry_fee(10)
                    .with_minimum_change_point(-10)
                    .with_maximum_change_point(30),
                season_rating.TierModel()
                    .with_raise_rank_bonus(60)
                    .with_entry_fee(20)
                    .with_minimum_change_point(-20)
                    .with_maximum_change_point(50),
                season_rating.TierModel()
                    .with_raise_rank_bonus(60)
                    .with_entry_fee(30)
                    .with_minimum_change_point(-30)
                    .with_maximum_change_point(60),
            ])
            .with_experience_model_id('grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level')
            .with_challenge_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.create_season_model_master({
    namespaceName="namespace-0001",
    name="mode1",
    description=nil,
    metadata=nil,
    tiers={
        {
            raiseRankBonus=0,
            entryFee=0,
            minimumChangePoint=-10,
            maximumChangePoint=20,
        },
        {
            raiseRankBonus=30,
            entryFee=10,
            minimumChangePoint=-10,
            maximumChangePoint=30,
        },
        {
            raiseRankBonus=60,
            entryFee=20,
            minimumChangePoint=-20,
            maximumChangePoint=50,
        },
        {
            raiseRankBonus=60,
            entryFee=30,
            minimumChangePoint=-30,
            maximumChangePoint=60,
        }
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level",
    challengePeriodEventId=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('season_rating')

api_result_handler = client.create_season_model_master_async({
    namespaceName="namespace-0001",
    name="mode1",
    description=nil,
    metadata=nil,
    tiers={
        {
            raiseRankBonus=0,
            entryFee=0,
            minimumChangePoint=-10,
            maximumChangePoint=20,
        },
        {
            raiseRankBonus=30,
            entryFee=10,
            minimumChangePoint=-10,
            maximumChangePoint=30,
        },
        {
            raiseRankBonus=60,
            entryFee=20,
            minimumChangePoint=-20,
            maximumChangePoint=50,
        },
        {
            raiseRankBonus=60,
            entryFee=30,
            minimumChangePoint=-30,
            maximumChangePoint=60,
        }
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level",
    challengePeriodEventId=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;

```




---

### getSeasonModelMaster

シーズンモデルマスターを取得<br>

レーティングティア、経験値モデル参照、挑戦期間イベント設定を含む、指定されたシーズンモデルマスターを取得します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SeasonModelMaster](#seasonmodelmaster) | シーズンモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetSeasonModelMaster(
    &season_rating.GetSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("mode1"),
    }
)
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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->getSeasonModelMaster(
        (new GetSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("mode1")
    );
    $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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetSeasonModelMasterRequest;
import io.gs2.seasonRating.result.GetSeasonModelMasterResult;

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

try {
    GetSeasonModelMasterResult result = client.getSeasonModelMaster(
        new GetSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
    );
    SeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.GetSeasonModelMasterResult> asyncResult = null;
yield return client.GetSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.GetSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("mode1"),
    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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getSeasonModelMaster(
        new Gs2SeasonRating.GetSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_season_model_master(
        season_rating.GetSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.get_season_model_master({
    namespaceName="namespace-0001",
    seasonName="mode1",
})

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

api_result_handler = client.get_season_model_master_async({
    namespaceName="namespace-0001",
    seasonName="mode1",
})

api_result = api_result_handler()  -- Call the handler 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;

```




---

### updateSeasonModelMaster

シーズンモデルマスターを更新<br>

指定されたシーズンモデルマスターのレーティングティア、経験値モデル参照、挑戦期間イベント、その他のプロパティを更新します。



#### Request

|  | 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128文字 | ネームスペース名<br>ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| seasonName | string |  | ✓|  |  ~ 128文字 | シーズンモデル名<br>シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
| description | string |  | |  |  ~ 1024文字 | 説明文 |
| metadata | string |  | |  |  ~ 128文字 | メタデータ<br>メタデータには任意の値を設定できます。<br/>これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 |
| tiers | [List&lt;TierModel&gt;](#tiermodel) |  | ✓|  | 1 ~ 100 items | ティアーモデルのリスト<br>シーズンのランキングラダーを構成するティアー定義の順序付きリスト。<br/>各ティアーは独自のポイント変動ルール（参加料、最小/最大変動量、昇格ボーナス）を定義します。<br/>プレイヤーは GS2-Experience で管理される累積ポイントに基づいてティアーを進行します。<br/>最小1ティアー、最大100ティアー。 |
| experienceModelId | string |  | ✓|  |  ~ 1024文字 | 経験値モデルID<br>シーズンポイントとティアー進行の管理に使用する GS2-Experience 経験値モデルの GRN。<br/>経験値モデルのランク閾値がティアー境界を決定し、経験値がプレイヤーの現在のシーズンポイントを表します。<br/>対戦結果によるポイント変動はこの経験値モデルに適用されます。 |
| challengePeriodEventId | string |  | |  |  ~ 1024文字 | チャレンジ期間イベントID<br>シーズンが対戦可能な期間を定義する GS2-Schedule イベントの GRN。<br/>設定した場合、参照先のイベントがアクティブな間のみプレイヤーは対戦に参加できます。<br/>未設定の場合、シーズンに期間制限はありません。 |

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SeasonModelMaster](#seasonmodelmaster) | 更新したシーズンモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateSeasonModelMaster(
    &season_rating.UpdateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("mode1"),
        Description: pointy.String("description1"),
        Metadata: nil,
        Tiers: []seasonRating.TierModel{
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(0),
                EntryFee: pointy.Int32(0),
                MinimumChangePoint: pointy.Int32(-100),
                MaximumChangePoint: pointy.Int32(200),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(300),
                EntryFee: pointy.Int32(100),
                MinimumChangePoint: pointy.Int32(-100),
                MaximumChangePoint: pointy.Int32(300),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(600),
                EntryFee: pointy.Int32(200),
                MinimumChangePoint: pointy.Int32(-200),
                MaximumChangePoint: pointy.Int32(500),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(600),
                EntryFee: pointy.Int32(300),
                MinimumChangePoint: pointy.Int32(-300),
                MaximumChangePoint: pointy.Int32(600),
            },
        },
        ExperienceModelId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2"),
        ChallengePeriodEventId: 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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->updateSeasonModelMaster(
        (new UpdateSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("mode1")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withTiers([
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(0)
                    ->withEntryFee(0)
                    ->withMinimumChangePoint(-100)
                    ->withMaximumChangePoint(200),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(300)
                    ->withEntryFee(100)
                    ->withMinimumChangePoint(-100)
                    ->withMaximumChangePoint(300),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(600)
                    ->withEntryFee(200)
                    ->withMinimumChangePoint(-200)
                    ->withMaximumChangePoint(500),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(600)
                    ->withEntryFee(300)
                    ->withMinimumChangePoint(-300)
                    ->withMaximumChangePoint(600),
            ])
            ->withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
            ->withChallengePeriodEventId(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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.UpdateSeasonModelMasterRequest;
import io.gs2.seasonRating.result.UpdateSeasonModelMasterResult;

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

try {
    UpdateSeasonModelMasterResult result = client.updateSeasonModelMaster(
        new UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withTiers(Arrays.asList(
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(200),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(300)
                    .withEntryFee(100)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(300),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(200)
                    .withMinimumChangePoint(-200)
                    .withMaximumChangePoint(500),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(300)
                    .withMinimumChangePoint(-300)
                    .withMaximumChangePoint(600)
            ))
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
            .withChallengePeriodEventId(null)
    );
    SeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.UpdateSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("mode1")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithTiers(new Gs2.Gs2SeasonRating.Model.TierModel[] {
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(0)
                .WithEntryFee(0)
                .WithMinimumChangePoint(-100)
                .WithMaximumChangePoint(200),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(300)
                .WithEntryFee(100)
                .WithMinimumChangePoint(-100)
                .WithMaximumChangePoint(300),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(600)
                .WithEntryFee(200)
                .WithMinimumChangePoint(-200)
                .WithMaximumChangePoint(500),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(600)
                .WithEntryFee(300)
                .WithMinimumChangePoint(-300)
                .WithMaximumChangePoint(600),
        })
        .WithExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
        .WithChallengePeriodEventId(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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.updateSeasonModelMaster(
        new Gs2SeasonRating.UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withTiers([
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(200),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(300)
                    .withEntryFee(100)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(300),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(200)
                    .withMinimumChangePoint(-200)
                    .withMaximumChangePoint(500),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(300)
                    .withMinimumChangePoint(-300)
                    .withMaximumChangePoint(600),
            ])
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
            .withChallengePeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.update_season_model_master(
        season_rating.UpdateSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('mode1')
            .with_description('description1')
            .with_metadata(None)
            .with_tiers([
                season_rating.TierModel()
                    .with_raise_rank_bonus(0)
                    .with_entry_fee(0)
                    .with_minimum_change_point(-100)
                    .with_maximum_change_point(200),
                season_rating.TierModel()
                    .with_raise_rank_bonus(300)
                    .with_entry_fee(100)
                    .with_minimum_change_point(-100)
                    .with_maximum_change_point(300),
                season_rating.TierModel()
                    .with_raise_rank_bonus(600)
                    .with_entry_fee(200)
                    .with_minimum_change_point(-200)
                    .with_maximum_change_point(500),
                season_rating.TierModel()
                    .with_raise_rank_bonus(600)
                    .with_entry_fee(300)
                    .with_minimum_change_point(-300)
                    .with_maximum_change_point(600),
            ])
            .with_experience_model_id('grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2')
            .with_challenge_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.update_season_model_master({
    namespaceName="namespace-0001",
    seasonName="mode1",
    description="description1",
    metadata=nil,
    tiers={
        {
            raiseRankBonus=0,
            entryFee=0,
            minimumChangePoint=-100,
            maximumChangePoint=200,
        },
        {
            raiseRankBonus=300,
            entryFee=100,
            minimumChangePoint=-100,
            maximumChangePoint=300,
        },
        {
            raiseRankBonus=600,
            entryFee=200,
            minimumChangePoint=-200,
            maximumChangePoint=500,
        },
        {
            raiseRankBonus=600,
            entryFee=300,
            minimumChangePoint=-300,
            maximumChangePoint=600,
        }
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2",
    challengePeriodEventId=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('season_rating')

api_result_handler = client.update_season_model_master_async({
    namespaceName="namespace-0001",
    seasonName="mode1",
    description="description1",
    metadata=nil,
    tiers={
        {
            raiseRankBonus=0,
            entryFee=0,
            minimumChangePoint=-100,
            maximumChangePoint=200,
        },
        {
            raiseRankBonus=300,
            entryFee=100,
            minimumChangePoint=-100,
            maximumChangePoint=300,
        },
        {
            raiseRankBonus=600,
            entryFee=200,
            minimumChangePoint=-200,
            maximumChangePoint=500,
        },
        {
            raiseRankBonus=600,
            entryFee=300,
            minimumChangePoint=-300,
            maximumChangePoint=600,
        }
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2",
    challengePeriodEventId=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;

```




---

### deleteSeasonModelMaster

シーズンモデルマスターを削除<br>

指定されたシーズンモデルマスターを削除します。



#### Request

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

#### Result

|  | 型 | 説明 |
| --- | --- | --- |
| item | [SeasonModelMaster](#seasonmodelmaster) | 削除したシーズンモデルマスター |

#### 実装例




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DeleteSeasonModelMaster(
    &season_rating.DeleteSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("mode1"),
    }
)
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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DeleteSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2SeasonRatingRestClient(
    $session
);

try {
    $result = $client->deleteSeasonModelMaster(
        (new DeleteSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("mode1")
    );
    $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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DeleteSeasonModelMasterRequest;
import io.gs2.seasonRating.result.DeleteSeasonModelMasterResult;

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

try {
    DeleteSeasonModelMasterResult result = client.deleteSeasonModelMaster(
        new DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
    );
    SeasonModelMaster 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 Gs2SeasonRatingRestClient(session);

AsyncResult<Gs2.Gs2SeasonRating.Result.DeleteSeasonModelMasterResult> asyncResult = null;
yield return client.DeleteSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.DeleteSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("mode1"),
    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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.deleteSeasonModelMaster(
        new Gs2SeasonRating.DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import season_rating

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

try:
    result = client.delete_season_model_master(
        season_rating.DeleteSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('season_rating')

api_result = client.delete_season_model_master({
    namespaceName="namespace-0001",
    seasonName="mode1",
})

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

api_result_handler = client.delete_season_model_master_async({
    namespaceName="namespace-0001",
    seasonName="mode1",
})

api_result = api_result_handler()  -- Call the handler 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;

```




---



