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

# GS2-Stamina SDK API 레퍼런스

각종 프로그래밍 언어용 GS2-Stamina SDK의 모델 사양과 API 레퍼런스



## 모델

### Namespace

네임스페이스<br>

네임스페이스는 하나의 프로젝트 내에서 동일한 서비스를 서로 다른 용도로 여러 개 이용하기 위한 엔티티입니다.<br>
GS2의 각 서비스는 네임스페이스 단위로 관리됩니다. 네임스페이스가 다르면 동일한 서비스라도 완전히 독립된 데이터 공간으로 취급됩니다.<br>

따라서 각 서비스의 이용을 시작하려면 먼저 네임스페이스를 생성해야 합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024자 | 네임스페이스 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| transactionSettingV2 | [TransactionSettingV2](#transactionsettingv2) |  |  |  |  | 트랜잭션 설정(V2)<br>이 네임스페이스가 발행하는 트랜잭션을 어떻게 실행할지 정하는 설정입니다. 설정하는 항목은 실행에 사용하는 GS2-Distributor 네임스페이스와, 트랜잭션에 포함된 액션을 한 건씩 실행해 앞서 실행된 액션의 결과를 후속 액션에서 사용할 수 있게 할지, 한꺼번에 동시에 실행해 응답 시간을 줄일지의 2가지뿐입니다.<br>새로 생성하는 네임스페이스에서는 이쪽을 설정하십시오. 이것으로 대체되어 비권장이 된 `transactionSetting`은 이쪽이 설정되어 있지 않은 동안에만 사용됩니다. |
| overflowTriggerScript | string |  |  |  |  ~ 1024자 | 오버플로우 트리거 스크립트<br>회복 시 스태미나가 오버플로우될 때 호출되는 GS2-Script의 GRN입니다.<br>시간 기반 회복으로 스태미나가 최대값을 초과하는 경우에 트리거되며, 초과분에 대한 커스텀 처리(예: 오버플로우분을 아이템으로 변환)가 가능합니다.<br>Script 트리거 레퍼런스 - [`overflow`](../script/#overflow) |
| logSetting | [LogSetting](#logsetting) |  |  |  |  | 로그 출력 설정<br>스태미나의 소비, 회복, 오버플로우 등의 조작을 GS2-Log에 기록하기 위한 로그 출력 설정입니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeNamespaces - 네임스페이스 목록 조회
getNamespace - 네임스페이스 조회
createNamespace - 네임스페이스 신규 생성
updateNamespace - 네임스페이스 갱신
deleteNamespace - 네임스페이스 삭제



---

### TransactionSettingV2

트랜잭션 설정(V2)<br>

트랜잭션 설정(V2)은 네임스페이스가 발행하는 트랜잭션을 어떻게 실행할지 정하는 설정입니다.<br>

설정하는 항목은 다음 2가지뿐입니다.<br>

- `distributorNamespaceId`: 트랜잭션 실행에 사용하는 GS2-Distributor 네임스페이스<br>
- `enableParallelExecution`: 트랜잭션에 포함된 액션을 한 건씩 실행할지, 한꺼번에 동시에 실행할지<br>

어느 쪽을 선택하더라도 트랜잭션은 발행된 시점에 서버가 실행하며, 성패는 트랜잭션 전체가 하나입니다. 어떤 액션이 실패한 경우에는 그때까지 실행된 액션까지 함께 취소되어 하나도 반영되지 않습니다. 트랜잭션의 실행 방법에 관한 그 밖의 항목은 권장 구성으로 고정되어 있으므로 설정할 필요가 없습니다.<br>

한 건씩 실행하는 경우(기본값 / `enableParallelExecution`이 `false`), 각 액션은 앞서 실행된 액션의 쓰기를 바탕으로 동작합니다. 액션은 verify・consume・acquire 순서로 실행되며, 다음을 할 수 있습니다.<br>

- 하나의 트랜잭션 안에서 같은 행을 여러 액션에서 갱신한다(한꺼번에 동시에 실행하는 경우에는 실패합니다)<br>
- 앞서 실행된 액션의 쓰기를 읽는다. List나 Query의 결과에서도, 중첩된 트랜잭션 내부에서도 읽을 수 있습니다<br>
- `%{Gs2Xxx:ActionName.path[0].field}`를 사용해 앞서 실행된 verify나 consume 액션의 결과를 후속 verify・consume・acquire 액션의 인수로 넘긴다<br>

그 대신 응답 시간은 각 액션의 실행 시간의 합계가 되고, 하나의 트랜잭션에 포함할 수 있는 액션은 최대 20건이 됩니다. 또한 각 페이즈 안에서의 실행 순서는 액션 이름, 그다음 대상 리소스로 결정되므로 요청에 나열한 순서로 실행 순서를 지정할 수는 없습니다. 실행은 가장 먼저 실패한 액션에서 중지됩니다.<br>

한꺼번에 동시에 실행하는 경우(`enableParallelExecution`이 `true`), 액션은 동일한 데이터 스냅샷에 대해 병렬로 실행되므로 응답 시간은 가장 느린 액션 1건분이면 되고 액션 수의 상한도 없습니다.<br>

그 대신 어떤 액션에서 다른 액션의 쓰기를 읽을 수 없으며, 두 액션이 같은 행을 갱신하면 트랜잭션은 `database:transaction:same.resource`(400)로 실패합니다. 같은 트랜잭션 안에서 두 개 이상의 액션이 같은 데이터를 갱신하지 않는다는 것을 보장할 수 있는 경우에만 선택하십시오. `%{...}`는 앞선 단계(verify → consume → acquire 순)의 결과만 참조할 수 있으며, 같은 단계 안의 액션에 대한 참조는 해결되지 않고 그대로 남습니다. `%{...}`를 포함하는 단계는 앞선 단계의 완료를 기다린 후 실행되므로 그만큼 응답 시간이 길어집니다.<br>

트랜잭션 설정은 트랜잭션 설정(V2)으로 대체된 비권장 설정으로, 트랜잭션 설정(V2)이 존재하지 않던 시기에 생성된 네임스페이스를 위해 남아 있습니다. 트랜잭션 설정(V2)이 설정되어 있지 않은 동안에만 적용되며, 트랜잭션 설정(V2)을 설정하면 그쪽이 우선합니다. 트랜잭션 설정에서 가능했던, 트랜잭션을 클라이언트 실행 스탬프 시트로 실행하는 것・GS2-Distributor를 통한 AutoRun의 비동기 실행・입수 액션의 GS2-JobQueue로의 통합이라는 3가지 동작은 여기에서는 의도적으로 제공하지 않습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| distributorNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:distributor:default" |  ~ 1024자 | 트랜잭션 실행에 사용하는 GS2-Distributor 네임스페이스GRN |
| enableParallelExecution | bool |  |  | false |  | 액션을 직렬이 아닌 병렬로 실행할지 여부 |

**관련 메서드:**
createNamespace - 네임스페이스 신규 생성
updateNamespace - 네임스페이스 갱신


**관련 모델:**
Namespace - 네임스페이스



---

### ScriptSetting

스크립트 설정<br>

GS2에서는 마이크로서비스의 이벤트에 연결하여 커스텀 스크립트를 실행할 수 있습니다.<br>
이 모델은 스크립트 실행을 트리거하기 위한 설정을 보유합니다.<br>

스크립트 실행 방식은 크게 두 가지로, 바로 "동기 실행"과 "비동기 실행"입니다.<br>
동기 실행은 스크립트 실행이 완료될 때까지 처리가 블록됩니다.<br>
대신 스크립트 실행 결과를 이용하여 API 실행을 중단시키거나 API 응답 내용을 제어할 수 있습니다.<br>

한편, 비동기 실행에서는 스크립트 완료를 기다리기 위해 처리가 블록되는 일이 없습니다.<br>
다만 스크립트 실행 결과를 이용하여 API 실행을 중단하거나 API 응답 내용을 변경할 수는 없습니다.<br>
비동기 실행은 API의 응답 흐름에 영향을 주지 않으므로 원칙적으로 비동기 실행을 권장합니다.<br>

비동기 실행에는 실행 방식이 두 가지 있으며, GS2-Script와 Amazon EventBridge가 있습니다.<br>
Amazon EventBridge를 사용함으로써 Lua 이외의 언어로 처리를 작성할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| triggerScriptId | string |  |  |  |  ~ 1024자 | API 실행 시 동기적으로 실행되는 GS2-Script의 스크립트GRN<br>"grn:gs2:"로 시작하는 GRN 형식의 ID로 지정해야 합니다. |
| doneTriggerTargetType | 문자열 열거형<br>enum {<br>"none",<br>"gs2_script",<br>"aws"<br>}<br> |  |  | "none" |  | 비동기 스크립트의 실행 방법<br>비동기 실행에서 사용할 스크립트의 종류를 지정합니다.<br>"비동기 실행의 스크립트를 사용하지 않음(none)", "GS2-Script를 사용함(gs2_script)", "Amazon EventBridge를 사용함(aws)" 중에서 선택할 수 있습니다.none: 없음 / gs2_script: GS2-Script / aws: Amazon EventBridge /  |
| doneTriggerScriptId | string | {doneTriggerTargetType} == "gs2_script" |  |  |  ~ 1024자 | 비동기 실행할 GS2-Script 스크립트GRN<br>"grn:gs2:"로 시작하는 GRN 형식의 ID로 지정해야 합니다.<br>※ doneTriggerTargetType이(가) "gs2_script" 이면 활성화 |
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == "gs2_script" |  |  |  ~ 1024자 | 비동기 실행 스크립트를 실행하는 GS2-JobQueue 네임스페이스GRN<br>비동기 실행 스크립트를 직접 실행하지 않고 GS2-JobQueue를 경유하는 경우 GS2-JobQueue의 네임스페이스GRN을 지정합니다.<br>GS2-JobQueue를 이용해야 할 이유는 많지 않으므로, 특별한 이유가 없다면 지정할 필요는 없습니다.<br>※ doneTriggerTargetType이(가) "gs2_script" 이면 활성화 |


---

### LogSetting

로그 출력 설정<br>

로그 데이터의 출력 설정을 관리합니다. 이 타입은 로그 데이터를 출력하기 위해 사용되는 GS2-Log 네임스페이스의 식별자(Namespace ID)를 보관합니다.<br>
로그 네임스페이스ID(loggingNamespaceId)에는 로그 데이터를 수집하여 저장하는 GS2-Log의 네임스페이스를 GRN 형식으로 지정합니다.<br>
이 설정을 하면 설정된 네임스페이스 내에서 발생한 API 요청·응답 로그 데이터가 대상 GS2-Log 네임스페이스 쪽으로 출력됩니다.<br>
GS2-Log에서는 실시간으로 로그가 제공되어 시스템 모니터링, 분석, 디버깅 등에 활용할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| loggingNamespaceId | string |  | ✓ |  |  ~ 1024자 | 로그를 출력할 GS2-Log의 네임스페이스GRN<br>"grn:gs2:"로 시작하는 GRN 형식의 ID로 지정해야 합니다. |

**관련 메서드:**
createNamespace - 네임스페이스 신규 생성
updateNamespace - 네임스페이스 갱신


**관련 모델:**
Namespace - 네임스페이스



---

### GitHubCheckoutSetting

GitHub에서 마스터 데이터를 체크아웃하는 설정


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| apiKeyId | string |  | ✓ |  |  ~ 1024자 | GitHub API 키의 GRN |
| repositoryName | string |  | ✓ |  |  ~ 1024자 | 리포지토리 이름 |
| sourcePath | string |  | ✓ |  |  ~ 1024자 | 마스터 데이터(JSON) 파일 경로 |
| referenceType | 문자열 열거형<br>enum {<br>"commit_hash",<br>"branch",<br>"tag"<br>}<br> |  | ✓ |  |  | 코드 출처commit_hash: 커밋 해시 / branch: 브랜치 / tag: 태그 /  |
| commitHash | string | {referenceType} == "commit_hash" | ✓※ |  |  ~ 1024자 | 커밋 해시<br>※ referenceType이(가) "commit_hash" 이면 필수 |
| branchName | string | {referenceType} == "branch" | ✓※ |  |  ~ 1024자 | 브랜치 이름<br>※ referenceType이(가) "branch" 이면 필수 |
| tagName | string | {referenceType} == "tag" | ✓※ |  |  ~ 1024자 | 태그 이름<br>※ referenceType이(가) "tag" 이면 필수 |

**관련 메서드:**
updateCurrentStaminaMasterFromGitHub - 현재 활성화된 스태미나 모델의 마스터 데이터를 GitHub에서 업데이트



---

### TransactionSetting

트랜잭션 설정<br>

트랜잭션 설정은 비권장입니다. 트랜잭션 설정(V2)이 이를 대체합니다. 트랜잭션 설정(V2)이 존재하지 않던 시기에 생성된 네임스페이스를 위해 남아 있으며, 트랜잭션 설정(V2)이 설정되어 있지 않은 동안에만 적용됩니다. 새로 생성하는 네임스페이스에서는 사용하지 마십시오.<br>

이 설정은 트랜잭션 실행에 관련된 요소――자동 실행(AutoRun), 원자적 실행(AtomicCommit), GS2-Distributor를 이용한 비동기 실행, 스크립트 결과의 일괄 적용, GS2-JobQueue를 통한 입수 액션의 비동기화, 직렬 실행――를 각각 개별 항목으로 공개하고 있기 때문에 권장 구성 이외의 조합도 만들 수 있습니다. 그 권장 구성을 하나의 설정으로 정리한 것이 트랜잭션 설정(V2)입니다. 트랜잭션 설정을 계속 사용하는 것은, 트랜잭션 설정(V2)이 제공하지 않는 동작――트랜잭션을 클라이언트 실행 스탬프 시트로 실행하는 것, GS2-Distributor를 통한 AutoRun의 비동기 실행, 입수 액션의 GS2-JobQueue로의 통합――에 이미 의존하고 있는 네임스페이스에 한정하십시오.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| enableAutoRun | bool |  |  | false |  | 발행한 트랜잭션을 서버 사이드에서 자동으로 실행할지 여부 |
| enableAtomicCommit | bool | {enableAutoRun} == true |  | false |  | 트랜잭션의 실행을 원자적으로 커밋할지 여부<br>※ enableAutoRun이(가) true 이면 활성화 |
| transactionUseDistributor | bool | {enableAtomicCommit} == true |  | false |  | 트랜잭션을 비동기 처리로 실행할지 여부<br>※ enableAtomicCommit이(가) true 이면 활성화 |
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true |  | false |  | 스크립트의 결과 커밋 처리를 비동기 처리로 실행할지 여부<br>※ transactionUseDistributor이(가) true 이면 활성화 |
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true |  | false |  | 입수 액션을 실행할 때 GS2-JobQueue를 사용할지 여부<br>※ enableAtomicCommit이(가) true 이면 활성화 |
| enableSequentialExecution | bool | {enableAtomicCommit} == true |  | false |  | 원자적 커밋의 액션을 직렬로 실행하여 여러 액션이 같은 행을 갱신할 수 있도록 할지 여부<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 - 네임스페이스



---

### Stamina

스태미나<br>

스태미나란 현실 시간의 경과에 따라 회복되는 포인트입니다.<br>
일반적으로 이 스태미나를 소비해야 게임을 플레이할 수 있도록 함으로써, 플레이어의 하루 플레이 횟수를 제한하고 게임의 진행 속도를 게임 제공사가 제어할 목적으로 사용됩니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| staminaId | string |  | ※ |  |  ~ 1024자 | 스타미나 GRN<br>※ 서버가 자동으로 설정 |
| staminaName | string |  | ✓ |  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| value | int |  | ✓ |  | 0 ~ 2147483646 | 스태미나 값<br>오버플로우분을 제외한, 이 사용자의 현재 스태미나 양입니다.<br>회복 간격과 회복량에 기반하여 시간 경과에 따라 자동으로 증가하며, maxValue까지 회복됩니다.<br>lastRecoveredAt로부터의 경과 시간을 사용하여 recoverSteps = elapsedMinutes / recoverIntervalMinutes 식으로 계산됩니다. |
| maxValue | int |  | ✓ |  | 1 ~ 2147483646 | 스태미나 최대값<br>StaminaModel로부터 결정되며, 옵션으로 플레이어의 GS2-Experience 랭크에 따라 MaxStaminaTable로 오버라이드되는 사용자별 스태미나 최대값입니다.<br>오버플로우가 비활성화된 경우 initialCapacity가 하한이 됩니다. 오버플로우가 활성화된 경우 maxCapacity가 상한이 됩니다.<br>자연 회복은 이 값에서 멈춥니다. |
| recoverIntervalMinutes | int |  |  |  | 1 ~ 2147483646 | 스태미나 회복 간격(분)<br>StaminaModel로부터 결정되며, 옵션으로 플레이어의 GS2-Experience 랭크에 따라 RecoverIntervalTable로 오버라이드되는 사용자별 회복 간격(분)입니다.<br>테이블이 설정되어 있지 않은 경우, 모델의 기본값인 recoverIntervalMinutes로 대체됩니다. |
| recoverValue | int |  |  |  | 1 ~ 2147483646 | 스태미나 회복량<br>StaminaModel로부터 결정되며, 옵션으로 플레이어의 GS2-Experience 랭크에 따라 RecoverValueTable로 오버라이드되는 사용자별 틱당 회복량입니다.<br>테이블이 설정되어 있지 않은 경우, 모델의 기본값인 recoverValue로 대체됩니다. |
| overflowValue | int |  | ✓ |  | 0 ~ 2147483646 | 오버플로우 값<br>통상의 최대값(maxValue)을 초과하여 저장되어 있는 스태미나량입니다.<br>StaminaModel의 isOverflow가 활성화된 경우에만 사용됩니다. 실효 스태미나의 합계는 value + overflowValue이며, maxCapacity가 상한입니다.<br>스태미나 소비 시 오버플로우분이 먼저 소비됩니다. |
| nextRecoverAt | long |  |  |  |  | 다음 회복 시각<br>다음 스태미나 회복 틱이 발생하는 Unix 타임스탬프(밀리초)입니다.<br>lastRecoveredAt + recoverIntervalMinutes * 60 * 1000으로 계산됩니다. 스태미나가 이미 maxValue인 경우, 이 필드는 설정되지 않을 수 있습니다. |
| lastRecoveredAt | long |  | ※ | 현재 시각 |  | 마지막으로 회복한 시각<br>UNIX 시간·밀리초<br>※서버 측에서 자동으로 설정 |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**

describeStaminas - 스타미나 목록 취득
describeStaminasByUserId - 사용자 ID를 지정하여 스타미나 목록 취득
getStamina - 스타미나 취득
getStaminaByUserId - 사용자 ID를 지정하여 스타미나 취득


updateStaminaByUserId - 사용자 ID를 지정하여 스타미나를 생성·갱신
setMaxValueByUserId - 사용자 ID를 지정하여 스타미나의 최대값을 갱신
setRecoverIntervalByUserId - 사용자 ID를 지정하여 스타미나 회복 간격(분)을 갱신
setRecoverValueByUserId - 사용자 ID를 지정하여 스타미나의 회복량을 설정
setMaxValueByStatus - GS2-Experience의 스테이터스를 사용하여 스타미나의 최대값을 갱신
setRecoverIntervalByStatus - GS2-Experience의 스테이터스를 사용하여 스타미나의 회복 간격을 갱신
setRecoverValueByStatus - GS2-Experience의 스테이터스를 사용하여 스타미나의 회복량을 갱신


consumeStamina - 스타미나 소비
consumeStaminaByUserId - 사용자 ID를 지정하여 스타미나 소비
applyStamina - 현재 스타미나의 자연 회복량을 적용
applyStaminaByUserId - 사용자 ID를 지정하여 현재 스타미나의 자연 회복량을 적용
recoverStaminaByUserId - 사용자 ID를 지정하여 스타미나 회복
raiseMaxValueByUserId - 사용자 ID를 지정하여 스타미나의 최대값을 가산
decreaseMaxValue - 스타미나 최대값 감산
decreaseMaxValueByUserId - 사용자 ID를 지정하여 스타미나 최대값 감산


verifyStaminaValue - 스타미나 현재값을 검증
verifyStaminaValueByUserId - 사용자 ID를 지정하여 스타미나 현재값을 검증
verifyStaminaMaxValue - 스태미나 최댓값 검증
verifyStaminaMaxValueByUserId - 사용자 ID를 지정하여 스태미나 최댓값 검증
verifyStaminaRecoverIntervalMinutes - 스태미나 회복 간격(분) 검증
verifyStaminaRecoverIntervalMinutesByUserId - 사용자 ID를 지정하여 스태미나 회복 간격(분) 검증
verifyStaminaRecoverValue - 스태미나 회복량 검증
verifyStaminaRecoverValueByUserId - 사용자 ID를 지정하여 스태미나 회복량 검증
verifyStaminaOverflowValue - 스태미나 오버플로우량 검증
verifyStaminaOverflowValueByUserId - 사용자 ID를 지정하여 스태미나 오버플로우량 검증


deleteStaminaByUserId - 사용자 ID를 지정하여 스타미나 삭제




---

### StaminaModel

스태미나 모델<br>

스태미나의 최대값, 회복 간격, 회복량과 같은 파라미터를 정의할 수 있습니다.<br>
GS2-Experience와 연동하여 최대값이나 회복량을 제어할 수도 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| staminaModelId | string |  | ※ |  |  ~ 1024자 | 스타미나 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 스태미나 모델 이름<br>스태미나 모델 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| recoverIntervalMinutes | int |  | ✓ |  | 0 ~ 2147483646 | 회복 간격(분)<br>스태미나 회복 틱의 간격(분 단위)입니다.<br>이 간격이 경과할 때마다 플레이어의 스태미나가 회복량만큼 증가합니다.<br>RecoverIntervalTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>0으로 설정하면 시간 기반 자동 회복이 비활성화됩니다. |
| recoverValue | int |  |  | 1 | 0 ~ 2147483646 | 회복량<br>회복 틱마다 회복되는 스태미나의 양입니다.<br>회복 간격이 경과할 때마다 최대값에 도달할 때까지 이 값만큼 스태미나가 증가합니다.<br>RecoverValueTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>기본값은 1입니다. |
| initialCapacity | int |  | ✓ |  | 0 ~ 2147483646 | 최대값의 초기값<br>모든 플레이어에 대한 기본 스태미나 최대값입니다.<br>오버플로우가 비활성화된 경우, 사용자별 최대값의 하한으로 작용합니다.<br>MaxStaminaTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다. |
| isOverflow | bool |  | ✓ |  |  | 오버플로우 가능 여부<br>아이템 사용 등의 수단으로 스태미나가 초기 최대값을 초과할 수 있는지 여부입니다.<br>활성화된 경우, 스태미나는 initialCapacity를 초과하여 maxCapacity까지 설정할 수 있습니다. 자연 회복은 일반적인 최대값에서 정지합니다.<br>비활성화된 경우, 사용자별 최대값은 initialCapacity 이상으로 제한됩니다. |
| maxCapacity | int | {isOverflow} == true | ✓※ |  | 0 ~ 2147483646 | 오버플로우 시 최대값<br>오버플로우 활성화 시 스태미나의 절대 상한값입니다.<br>오버플로우 상태에서도 스태미나는 이 값을 초과할 수 없습니다. isOverflow가 true인 경우에만 표시됩니다.<br>예를 들어 initialCapacity가 100, maxCapacity가 200인 경우, 아이템으로 스태미나를 200까지 늘릴 수 있지만 자연 회복은 100에서 정지합니다.<br>※ isOverflow이(가) true 이면 필수 |
| maxStaminaTable | [MaxStaminaTable](#maxstaminatable) |  |  |  |  | 스태미나 최대값 테이블<br>플레이어의 GS2-Experience 랭크에 기반하여 스태미나 최대값을 동적으로 결정하는 MaxStaminaTable에 대한 참조입니다.<br>설정 시, 플레이어의 최대 스태미나는 현재 랭크 인덱스로 테이블에서 참조되며, initialCapacity를 오버라이드합니다.<br>미설정 시, 모든 플레이어가 동일한 initialCapacity를 최대값으로 공유합니다. |
| recoverIntervalTable | [RecoverIntervalTable](#recoverintervaltable) |  |  |  |  | 회복 간격 테이블<br>플레이어의 GS2-Experience 랭크에 기반하여 회복 간격을 동적으로 결정하는 RecoverIntervalTable에 대한 참조입니다.<br>설정 시, 플레이어의 회복 간격은 현재 랭크 인덱스로 테이블에서 참조되며, recoverIntervalMinutes를 오버라이드합니다.<br>미설정 시, 모든 플레이어가 동일한 recoverIntervalMinutes를 공유합니다. |
| recoverValueTable | [RecoverValueTable](#recovervaluetable) |  |  |  |  | 회복량 테이블<br>플레이어의 GS2-Experience 랭크에 기반하여 회복량을 동적으로 결정하는 RecoverValueTable에 대한 참조입니다.<br>설정 시, 플레이어의 회복량은 현재 랭크 인덱스로 테이블에서 참조되며, recoverValue를 오버라이드합니다.<br>미설정 시, 모든 플레이어가 동일한 recoverValue를 공유합니다. |

**관련 메서드:**

getStamina - 스타미나 취득
getStaminaByUserId - 사용자 ID를 지정하여 스타미나 취득
describeStaminaModels - 스타미나 모델 목록 취득
getStaminaModel - 스타미나 모델 취득


updateStaminaByUserId - 사용자 ID를 지정하여 스타미나를 생성·갱신
setMaxValueByUserId - 사용자 ID를 지정하여 스타미나의 최대값을 갱신
setRecoverIntervalByUserId - 사용자 ID를 지정하여 스타미나 회복 간격(분)을 갱신
setRecoverValueByUserId - 사용자 ID를 지정하여 스타미나의 회복량을 설정
setMaxValueByStatus - GS2-Experience의 스테이터스를 사용하여 스타미나의 최대값을 갱신
setRecoverIntervalByStatus - GS2-Experience의 스테이터스를 사용하여 스타미나의 회복 간격을 갱신
setRecoverValueByStatus - GS2-Experience의 스테이터스를 사용하여 스타미나의 회복량을 갱신


consumeStamina - 스타미나 소비
consumeStaminaByUserId - 사용자 ID를 지정하여 스타미나 소비
applyStamina - 현재 스타미나의 자연 회복량을 적용
applyStaminaByUserId - 사용자 ID를 지정하여 현재 스타미나의 자연 회복량을 적용
recoverStaminaByUserId - 사용자 ID를 지정하여 스타미나 회복
raiseMaxValueByUserId - 사용자 ID를 지정하여 스타미나의 최대값을 가산
decreaseMaxValue - 스타미나 최대값 감산
decreaseMaxValueByUserId - 사용자 ID를 지정하여 스타미나 최대값 감산




---

### MaxStaminaTable

스태미나 최대값 테이블<br>

스태미나 최대값 테이블은 GS2-Experience의 랭크별로 스태미나의 최대값을 정의하는 엔티티입니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ |  |  ~ 128자 | 스태미나 최대값 테이블 이름<br>스태미나 최대값 테이블 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓ |  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 스태미나 최대값이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓ |  | 1 ~ 1024 items | 랭크별 스태미나 최대값<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 스태미나 최대값의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 최대 스태미나로 사용됩니다. 배열 길이는 참조하는 ExperienceModel에서 정의된 랭크 수와 일치해야 합니다. |

**관련 모델:**
StaminaModel - 스태미나 모델



---

### RecoverIntervalTable

회복 간격 테이블<br>

회복 간격 테이블은 GS2-Experience의 랭크별로 스태미나의 회복 간격을 정의하는 엔티티입니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ |  |  ~ 128자 | 회복 간격 테이블 이름<br>회복 간격 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓ |  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복 간격이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓ |  | 1 ~ 1024 items | 랭크별 회복 간격(분)<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복 간격 값(분 단위)의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 회복 간격으로 사용되며, 모델의 기본값 recoverIntervalMinutes를 오버라이드합니다. |

**관련 모델:**
StaminaModel - 스태미나 모델



---

### RecoverValueTable

스태미나 회복량 테이블<br>

스태미나 회복량 테이블은 GS2-Experience의 랭크별로 스태미나의 회복량을 정의하는 엔티티입니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ |  |  ~ 128자 | 스태미나 회복량 테이블 이름<br>스태미나 회복량 테이블 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓ |  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복량이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓ |  | 1 ~ 1024 items | 랭크별 회복량<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복량 값의 배열입니다.<br>인덱스 i의 값은 랭크 i의 플레이어에 대한 틱당 회복량으로 사용되며, 모델의 기본 recoverValue를 오버라이드합니다. |

**관련 모델:**
StaminaModel - 스태미나 모델



---

### CurrentStaminaMaster

현재 활성화된 스태미나 모델의 마스터 데이터<br>

현재 네임스페이스 내에서 유효한 스태미나 모델의 정의를 기술한 마스터 데이터입니다.<br>
GS2에서는 마스터 데이터 관리에 JSON 형식의 파일을 사용합니다.<br>
파일을 업로드함으로써 실제로 서버에 설정을 반영할 수 있습니다.<br>

JSON 파일을 작성하는 방법으로, 매니지먼트 콘솔 내에 마스터 데이터 에디터를 제공하고 있습니다.<br>
또한 게임 운영에 더 적합한 도구를 직접 제작하여 적절한 형식의 JSON 파일을 출력하는 방식으로도 서비스를 이용할 수 있습니다.
**ℹ️ Note**

JSON 파일 형식에 대해서는 [GS2-Stamina 마스터 데이터 레퍼런스](api_reference/stamina/master_data/)를 참조해 주세요.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024자 | 네임스페이스 GRN<br>※ 서버가 자동으로 설정 |
| settings | string |  | ✓ |  |  ~ 5242880 바이트 (5MB) | 마스터 데이터 |

**관련 메서드:**
getCurrentStaminaMaster - 현재 활성화된 스태미나 모델 마스터 데이터 가져오기
updateCurrentStaminaMaster - 현재 활성화된 스태미나 모델의 마스터 데이터를 업데이트
updateCurrentStaminaMasterFromGitHub - 현재 활성화된 스태미나 모델의 마스터 데이터를 GitHub에서 업데이트
exportMaster - 스태미나 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보내기



---

### StaminaModelMaster

스태미나 모델 마스터<br>

스태미나 모델 마스터는 게임 내에서 사용되는 스태미나 모델의 편집·관리용 데이터로, 매니지먼트 콘솔의 마스터 데이터 에디터에 일시적으로 보관됩니다.<br>
임포트·업데이트 처리를 수행함으로써 실제로 게임에서 참조되는 스태미나 모델로 반영됩니다.<br>

스태미나의 최대값, 회복 간격, 회복량과 같은 파라미터를 정의할 수 있습니다.<br>
GS2-Experience와 연동하여 최대값이나 회복량을 제어할 수도 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| staminaModelId | string |  | ※ |  |  ~ 1024자 | 스타미나 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 스태미나 모델 이름<br>스태미나 모델 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| recoverIntervalMinutes | int |  | ✓ |  | 0 ~ 2147483646 | 회복 간격(분)<br>스태미나 회복 틱의 간격(분 단위)입니다.<br>이 간격이 경과할 때마다 플레이어의 스태미나가 회복량만큼 증가합니다.<br>RecoverIntervalTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>0으로 설정하면 시간 기반 자동 회복이 비활성화됩니다. |
| recoverValue | int |  |  | 1 | 0 ~ 2147483646 | 회복량<br>회복 틱마다 회복되는 스태미나의 양입니다.<br>회복 간격이 경과할 때마다 최대값에 도달할 때까지 이 값만큼 스태미나가 증가합니다.<br>RecoverValueTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>기본값은 1입니다. |
| initialCapacity | int |  | ✓ |  | 0 ~ 2147483646 | 최대값의 초기값<br>모든 플레이어에 대한 기본 스태미나 최대값입니다.<br>오버플로우가 비활성화된 경우, 사용자별 최대값의 하한으로 작용합니다.<br>MaxStaminaTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다. |
| isOverflow | bool |  | ✓ |  |  | 오버플로우 가능 여부<br>아이템 사용 등의 수단으로 스태미나가 초기 최대값을 초과할 수 있는지 여부입니다.<br>활성화된 경우, 스태미나는 initialCapacity를 초과하여 maxCapacity까지 설정할 수 있습니다. 자연 회복은 일반적인 최대값에서 정지합니다.<br>비활성화된 경우, 사용자별 최대값은 initialCapacity 이상으로 제한됩니다. |
| maxCapacity | int | {isOverflow} == true | ✓※ |  | 0 ~ 2147483646 | 오버플로우 시 최대값<br>오버플로우 활성화 시 스태미나의 절대 상한값입니다.<br>오버플로우 상태에서도 스태미나는 이 값을 초과할 수 없습니다. isOverflow가 true인 경우에만 표시됩니다.<br>※ isOverflow이(가) true 이면 필수 |
| maxStaminaTableName | string |  |  |  |  ~ 128자 | 스태미나 최대값 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 스태미나 최대값을 동적으로 결정하는 MaxStaminaTable의 이름입니다.<br>설정 시, 플레이어의 최대 스태미나는 현재 랭크 인덱스로 테이블에서 참조되며, initialCapacity를 오버라이드합니다. |
| recoverIntervalTableName | string |  |  |  |  ~ 128자 | 회복 간격 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 회복 간격을 동적으로 결정하는 RecoverIntervalTable의 이름입니다.<br>설정 시, 플레이어의 회복 간격은 테이블에서 참조되며, recoverIntervalMinutes를 오버라이드합니다. |
| recoverValueTableName | string |  |  |  |  ~ 128자 | 회복량 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 회복량을 동적으로 결정하는 RecoverValueTable의 이름입니다.<br>설정 시, 플레이어의 회복량은 테이블에서 참조되며, recoverValue를 오버라이드합니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeStaminaModelMasters - 스태미나 모델 마스터 목록 가져오기
getStaminaModelMaster - 스태미나 모델 마스터 가져오기
createStaminaModelMaster - 스태미나 모델 마스터 신규 생성
updateStaminaModelMaster - 스태미나 모델 마스터 갱신
deleteStaminaModelMaster - 스태미나 모델 마스터 삭제



---

### MaxStaminaTableMaster

스태미나 최대값 테이블 마스터<br>

스태미나 최대값 테이블 마스터는 게임 내에서 사용되는 스태미나 최대값 테이블의 편집·관리용 데이터로, 매니지먼트 콘솔의 마스터 데이터 에디터에서 일시적으로 보관됩니다.<br>
임포트·업데이트 처리를 수행함으로써, 실제로 게임에서 참조되는 스태미나 최대값 테이블로 반영됩니다.<br>

스태미나 최대값 테이블은 GS2-Experience의 랭크별로 스태미나의 최대값을 정의하는 엔티티입니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| maxStaminaTableId | string |  | ※ |  |  ~ 1024자 | 스타미나 최대값 테이블 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 최대 스태미나 값 테이블 이름<br>최대 스태미나 값 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| experienceModelId | string |  | ✓ |  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 스태미나 최대값이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓ |  | 1 ~ 1024 items | 랭크별 스태미나 최대값<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 스태미나 최대값의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 최대 스태미나로 사용됩니다. 배열 길이는 참조하는 ExperienceModel에서 정의된 랭크 수와 일치해야 합니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeMaxStaminaTableMasters - 스태미나 최댓값 테이블 마스터 목록 가져오기
getMaxStaminaTableMaster - 스태미나 최댓값 테이블 마스터 가져오기
createMaxStaminaTableMaster - 스태미나 최댓값 테이블 마스터 신규 생성
updateMaxStaminaTableMaster - 스태미나 최댓값 테이블 마스터 갱신
deleteMaxStaminaTableMaster - 스태미나 최댓값 테이블 마스터 삭제



---

### RecoverIntervalTableMaster

회복 간격 테이블 마스터<br>

회복 간격 테이블 마스터는 게임 내에서 사용되는 회복 간격 테이블의 편집·관리용 데이터로, 매니지먼트 콘솔의 마스터 데이터 에디터에 일시적으로 보관됩니다.<br>
임포트·업데이트 처리를 수행함으로써 실제로 게임에서 참조되는 회복 간격 테이블로 반영됩니다.<br>

회복 간격 테이블은 GS2-Experience의 랭크별로 스태미나의 회복 간격을 정의하는 엔티티입니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| recoverIntervalTableId | string |  | ※ |  |  ~ 1024자 | 회복 간격 테이블 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 회복 간격 테이블 이름<br>회복 간격 테이블 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| experienceModelId | string |  | ✓ |  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복 간격이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓ |  | 1 ~ 1024 items | 랭크별 회복 간격(분)<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복 간격 값(분 단위)의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 회복 간격으로 사용되며, 모델의 기본값 recoverIntervalMinutes를 오버라이드합니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeRecoverIntervalTableMasters - 회복 간격 테이블 마스터 목록 취득
getRecoverIntervalTableMaster - 회복 간격 테이블 마스터를 취득
createRecoverIntervalTableMaster - 회복 간격 테이블 마스터를 신규 작성
updateRecoverIntervalTableMaster - 회복 간격 테이블 마스터를 업데이트
deleteRecoverIntervalTableMaster - 회복 간격 테이블 마스터를 삭제



---

### RecoverValueTableMaster

스태미나 회복량 테이블 마스터<br>

스태미나 회복량 테이블 마스터는 게임 내에서 사용되는 스태미나 회복량 테이블의 편집·관리용 데이터로, 매니지먼트 콘솔의 마스터 데이터 에디터에서 일시적으로 보관됩니다.<br>
임포트·업데이트 처리를 수행함으로써, 실제로 게임에서 참조되는 스태미나 회복량 테이블로 반영됩니다.<br>

스태미나 회복량 테이블은 GS2-Experience의 랭크별로 스태미나의 회복량을 정의하는 엔티티입니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| recoverValueTableId | string |  | ※ |  |  ~ 1024자 | 스타미나 회복량 테이블 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 스태미나 회복량 테이블 이름<br>스태미나 회복량 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| experienceModelId | string |  | ✓ |  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복량이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓ |  | 1 ~ 1024 items | 랭크별 회복량<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복량 값의 배열입니다.<br>인덱스 i의 값은 랭크 i의 플레이어에 대한 틱당 회복량으로 사용되며, 모델의 기본 recoverValue를 오버라이드합니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간·밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeRecoverValueTableMasters - 스태미나 회복량 테이블 마스터 목록 가져오기
getRecoverValueTableMaster - 스태미나 회복량 테이블 마스터 가져오기
createRecoverValueTableMaster - 스태미나 회복량 테이블 마스터 신규 생성
updateRecoverValueTableMaster - 스태미나 회복량 테이블 마스터 갱신
deleteRecoverValueTableMaster - 스태미나 회복량 테이블 마스터 삭제



---
## 메서드

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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자 | 설명문 |
| transactionSettingV2 | [TransactionSettingV2](#transactionsettingv2) |  | |  |  | 트랜잭션 설정(V2)<br>이 네임스페이스가 발행하는 트랜잭션을 어떻게 실행할지 정하는 설정입니다. 설정하는 항목은 실행에 사용하는 GS2-Distributor 네임스페이스와, 트랜잭션에 포함된 액션을 한 건씩 실행해 앞서 실행된 액션의 결과를 후속 액션에서 사용할 수 있게 할지, 한꺼번에 동시에 실행해 응답 시간을 줄일지의 2가지뿐입니다.<br>새로 생성하는 네임스페이스에서는 이쪽을 설정하십시오. 이것으로 대체되어 비권장이 된 `transactionSetting`은 이쪽이 설정되어 있지 않은 동안에만 사용됩니다. |
| overflowTriggerScript | string |  | |  |  ~ 1024자 | 오버플로우 트리거 스크립트<br>회복 시 스태미나가 오버플로우될 때 호출되는 GS2-Script의 GRN입니다.<br>시간 기반 회복으로 스태미나가 최대값을 초과하는 경우에 트리거되며, 초과분에 대한 커스텀 처리(예: 오버플로우분을 아이템으로 변환)가 가능합니다.<br>Script 트리거 레퍼런스 - [`overflow`](../script/#overflow) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | 로그 출력 설정<br>스태미나의 소비, 회복, 오버플로우 등의 조작을 GS2-Log에 기록하기 위한 로그 출력 설정입니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Namespace](#namespace) | 생성한 네임스페이스 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &stamina.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSettingV2: nil,
        OverflowTriggerScript: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script"),
        LogSetting: &stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSettingV2(null)
            ->withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
            ->withLogSetting((new \Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateNamespaceRequest;
import io.gs2.stamina.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSettingV2(null)
            .withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
            .withLogSetting(new io.gs2.stamina.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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Stamina.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSettingV2(null)
        .WithOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
        .WithLogSetting(new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.createNamespace(
        new Gs2Stamina.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSettingV2(null)
            .withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
            .withLogSetting(new Gs2Stamina.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 stamina

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

try:
    result = client.create_namespace(
        stamina.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting_v2(None)
            .with_overflow_trigger_script('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script')
            .with_log_setting(
                stamina.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('stamina')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSettingV2=nil,
    overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
    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('stamina')

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

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

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

result = api_result.result
item = result.item;

```



---

### getNamespaceStatus

네임스페이스의 상태 조회<br>

지정된 네임스페이스의 현재 상태를 조회합니다.<br>
상태에는 네임스페이스가 활성 상태인지, 삭제되었는지가 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| status | string | 네임스페이스의 상태<br>ACTIVE: 유효 / DELETED: 삭제됨 /  |

#### 구현 예제




**Go**
```go

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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자 | 설명문 |
| transactionSettingV2 | [TransactionSettingV2](#transactionsettingv2) |  | |  |  | 트랜잭션 설정(V2)<br>이 네임스페이스가 발행하는 트랜잭션을 어떻게 실행할지 정하는 설정입니다. 설정하는 항목은 실행에 사용하는 GS2-Distributor 네임스페이스와, 트랜잭션에 포함된 액션을 한 건씩 실행해 앞서 실행된 액션의 결과를 후속 액션에서 사용할 수 있게 할지, 한꺼번에 동시에 실행해 응답 시간을 줄일지의 2가지뿐입니다.<br>새로 생성하는 네임스페이스에서는 이쪽을 설정하십시오. 이것으로 대체되어 비권장이 된 `transactionSetting`은 이쪽이 설정되어 있지 않은 동안에만 사용됩니다. |
| overflowTriggerScript | string |  | |  |  ~ 1024자 | 오버플로우 트리거 스크립트<br>회복 시 스태미나가 오버플로우될 때 호출되는 GS2-Script의 GRN입니다.<br>시간 기반 회복으로 스태미나가 최대값을 초과하는 경우에 트리거되며, 초과분에 대한 커스텀 처리(예: 오버플로우분을 아이템으로 변환)가 가능합니다.<br>Script 트리거 레퍼런스 - [`overflow`](../script/#overflow) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | 로그 출력 설정<br>스태미나의 소비, 회복, 오버플로우 등의 조작을 GS2-Log에 기록하기 위한 로그 출력 설정입니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Namespace](#namespace) | 갱신한 네임스페이스 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &stamina.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSettingV2: nil,
        OverflowTriggerScript: nil,
        LogSetting: &stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSettingV2=nil,
    overflowTriggerScript=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/stamina"
import "github.com/openlyinc/pointy"

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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;

```



---

### describeStaminas

스타미나 목록 취득<br>

요청 사용자의 모든 스타미나 리소스에 대한 페이지네이션 목록을 취득합니다. 각 스타미나 항목에는 현재값, 최대값, 회복 설정, 오버플로량이 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;Stamina&gt;](#stamina) | 스태미나 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DescribeStaminas(
    &stamina.DescribeStaminasRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminasRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

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

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminasRequest;
import io.gs2.stamina.result.DescribeStaminasResult;

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

try {
    DescribeStaminasResult result = client.describeStaminas(
        new DescribeStaminasRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Stamina> 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminasResult> asyncResult = null;
yield return client.DescribeStaminas(
    new Gs2.Gs2Stamina.Request.DescribeStaminasRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.describeStaminas(
        new Gs2Stamina.DescribeStaminasRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.describe_staminas(
        stamina.DescribeStaminasRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

```

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

client = gs2('stamina')

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

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

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

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

```



---

### describeStaminasByUserId

사용자 ID를 지정하여 스타미나 목록 취득<br>

지정된 사용자의 모든 스타미나 리소스에 대한 페이지네이션 목록을 취득합니다. 각 스타미나 항목에는 현재값, 최대값, 회복 설정, 오버플로량이 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;Stamina&gt;](#stamina) | 스태미나 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DescribeStaminasByUserId(
    &stamina.DescribeStaminasByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminasByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

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

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminasByUserIdRequest;
import io.gs2.stamina.result.DescribeStaminasByUserIdResult;

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

try {
    DescribeStaminasByUserIdResult result = client.describeStaminasByUserId(
        new DescribeStaminasByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Stamina> 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 Gs2StaminaRestClient(session);

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

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

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

```

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

client = gs2('stamina')

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

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

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

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

```



---

### getStamina

스타미나 취득<br>

지정된 스타미나 리소스와 해당 스타미나 모델을 취득합니다. 현재 스타미나 값, 최대값, 회복 간격, 회복량, 오버플로량을 반환합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetStamina(
    &stamina.GetStaminaRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStamina(
        (new GetStaminaRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaRequest;
import io.gs2.stamina.result.GetStaminaResult;

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

try {
    GetStaminaResult result = client.getStamina(
        new GetStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaResult> asyncResult = null;
yield return client.GetStamina(
    new Gs2.Gs2Stamina.Request.GetStaminaRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.getStamina(
        new Gs2Stamina.GetStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_stamina(
        stamina.GetStaminaRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.get_stamina({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.get_stamina_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```



---

### getStaminaByUserId

사용자 ID를 지정하여 스타미나 취득<br>

지정된 사용자의 스타미나 리소스와 해당 스타미나 모델을 취득합니다. 현재 스타미나 값, 최대값, 회복 간격, 회복량, 오버플로량을 반환합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetStaminaByUserId(
    &stamina.GetStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStaminaByUserId(
        (new GetStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaByUserIdRequest;
import io.gs2.stamina.result.GetStaminaByUserIdResult;

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

try {
    GetStaminaByUserIdResult result = client.getStaminaByUserId(
        new GetStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaByUserIdResult> asyncResult = null;
yield return client.GetStaminaByUserId(
    new Gs2.Gs2Stamina.Request.GetStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.getStaminaByUserId(
        new Gs2Stamina.GetStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_stamina_by_user_id(
        stamina.GetStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

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

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```



---

### updateStaminaByUserId

사용자 ID를 지정하여 스타미나를 생성·갱신<br>

현재값, 최대값, 회복 간격, 회복량을 포함한 모든 스타미나 속성을 한 번에 설정합니다. 이는 현재 오버플로량과 마지막 회복 타임스탬프를 유지한 채로 직접 값을 덮어쓰기 위한 관리 작업입니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| value | int |  | ✓|  | 0 ~ 2147483646 | 스태미나 값<br>오버플로우분을 제외한, 이 사용자의 현재 스태미나 양입니다.<br>회복 간격과 회복량에 기반하여 시간 경과에 따라 자동으로 증가하며, maxValue까지 회복됩니다.<br>lastRecoveredAt로부터의 경과 시간을 사용하여 recoverSteps = elapsedMinutes / recoverIntervalMinutes 식으로 계산됩니다. |
| maxValue | int |  | ✓|  | 1 ~ 2147483646 | 스태미나 최대값<br>StaminaModel로부터 결정되며, 옵션으로 플레이어의 GS2-Experience 랭크에 따라 MaxStaminaTable로 오버라이드되는 사용자별 스태미나 최대값입니다.<br>오버플로우가 비활성화된 경우 initialCapacity가 하한이 됩니다. 오버플로우가 활성화된 경우 maxCapacity가 상한이 됩니다.<br>자연 회복은 이 값에서 멈춥니다. |
| recoverIntervalMinutes | int |  | |  | 1 ~ 2147483646 | 스태미나 회복 간격(분)<br>StaminaModel로부터 결정되며, 옵션으로 플레이어의 GS2-Experience 랭크에 따라 RecoverIntervalTable로 오버라이드되는 사용자별 회복 간격(분)입니다.<br>테이블이 설정되어 있지 않은 경우, 모델의 기본값인 recoverIntervalMinutes로 대체됩니다. |
| recoverValue | int |  | |  | 1 ~ 2147483646 | 스태미나 회복량<br>StaminaModel로부터 결정되며, 옵션으로 플레이어의 GS2-Experience 랭크에 따라 RecoverValueTable로 오버라이드되는 사용자별 틱당 회복량입니다.<br>테이블이 설정되어 있지 않은 경우, 모델의 기본값인 recoverValue로 대체됩니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateStaminaByUserId(
    &stamina.UpdateStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        Value: pointy.Int32(50),
        MaxValue: pointy.Int32(100),
        RecoverIntervalMinutes: nil,
        RecoverValue: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateStaminaByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateStaminaByUserId(
        (new UpdateStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withValue(50)
            ->withMaxValue(100)
            ->withRecoverIntervalMinutes(null)
            ->withRecoverValue(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateStaminaByUserIdRequest;
import io.gs2.stamina.result.UpdateStaminaByUserIdResult;

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

try {
    UpdateStaminaByUserIdResult result = client.updateStaminaByUserId(
        new UpdateStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withValue(50)
            .withMaxValue(100)
            .withRecoverIntervalMinutes(null)
            .withRecoverValue(null)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.UpdateStaminaByUserIdResult> asyncResult = null;
yield return client.UpdateStaminaByUserId(
    new Gs2.Gs2Stamina.Request.UpdateStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithValue(50)
        .WithMaxValue(100)
        .WithRecoverIntervalMinutes(null)
        .WithRecoverValue(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.updateStaminaByUserId(
        new Gs2Stamina.UpdateStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withValue(50)
            .withMaxValue(100)
            .withRecoverIntervalMinutes(null)
            .withRecoverValue(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.update_stamina_by_user_id(
        stamina.UpdateStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_value(50)
            .with_max_value(100)
            .with_recover_interval_minutes(None)
            .with_recover_value(None)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.update_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    value=50,
    maxValue=100,
    recoverIntervalMinutes=nil,
    recoverValue=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.update_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    value=50,
    maxValue=100,
    recoverIntervalMinutes=nil,
    recoverValue=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```



---

### consumeStamina

스타미나 소비<br>

현재 스타미나 값에서 지정된 양을 차감합니다. 현재 스타미나 값이 소비량보다 적은 경우 Insufficient 오류를 반환합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| consumeValue | int |  | ✓|  | 1 ~ 2147483646 | 소비할 스타미나 양 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.ConsumeStamina(
    &stamina.ConsumeStaminaRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ConsumeValue: pointy.Int32(50),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ConsumeStaminaRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->consumeStamina(
        (new ConsumeStaminaRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withConsumeValue(50)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ConsumeStaminaRequest;
import io.gs2.stamina.result.ConsumeStaminaResult;

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

try {
    ConsumeStaminaResult result = client.consumeStamina(
        new ConsumeStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withConsumeValue(50)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.ConsumeStaminaResult> asyncResult = null;
yield return client.ConsumeStamina(
    new Gs2.Gs2Stamina.Request.ConsumeStaminaRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithConsumeValue(50),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.consumeStamina(
        new Gs2Stamina.ConsumeStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withConsumeValue(50)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.consume_stamina(
        stamina.ConsumeStaminaRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_consume_value(50)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.consume_stamina({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    consumeValue=50,
})

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.consume_stamina_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    consumeValue=50,
})

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

```



---

### consumeStaminaByUserId

사용자 ID를 지정하여 스타미나 소비<br>

지정된 사용자의 현재 스타미나 값에서 지정된 양을 차감합니다. 현재 스타미나 값이 소비량보다 적은 경우 Insufficient 오류를 반환합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| consumeValue | int |  | ✓|  | 1 ~ 2147483646 | 소비할 스타미나 양 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.ConsumeStaminaByUserId(
    &stamina.ConsumeStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        ConsumeValue: pointy.Int32(50),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ConsumeStaminaByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->consumeStaminaByUserId(
        (new ConsumeStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withConsumeValue(50)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ConsumeStaminaByUserIdRequest;
import io.gs2.stamina.result.ConsumeStaminaByUserIdResult;

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

try {
    ConsumeStaminaByUserIdResult result = client.consumeStaminaByUserId(
        new ConsumeStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withConsumeValue(50)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.ConsumeStaminaByUserIdResult> asyncResult = null;
yield return client.ConsumeStaminaByUserId(
    new Gs2.Gs2Stamina.Request.ConsumeStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithConsumeValue(50)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.consumeStaminaByUserId(
        new Gs2Stamina.ConsumeStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withConsumeValue(50)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.consume_stamina_by_user_id(
        stamina.ConsumeStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_consume_value(50)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.consume_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    consumeValue=50,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.consume_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    consumeValue=50,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```



---

### applyStamina

현재 스타미나의 자연 회복량을 적용<br>

시간 경과에 기반한 자동 스타미나 회복을 계산하여 적용합니다. 회복량은 마지막 회복 이후 경과 시간, 스타미나 모델에 설정된 회복 간격과 회복량을 기반으로 계산됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.ApplyStamina(
    &stamina.ApplyStaminaRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ApplyStaminaRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->applyStamina(
        (new ApplyStaminaRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ApplyStaminaRequest;
import io.gs2.stamina.result.ApplyStaminaResult;

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

try {
    ApplyStaminaResult result = client.applyStamina(
        new ApplyStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.ApplyStaminaResult> asyncResult = null;
yield return client.ApplyStamina(
    new Gs2.Gs2Stamina.Request.ApplyStaminaRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.applyStamina(
        new Gs2Stamina.ApplyStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.apply_stamina(
        stamina.ApplyStaminaRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.apply_stamina({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.apply_stamina_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```



---

### applyStaminaByUserId

사용자 ID를 지정하여 현재 스타미나의 자연 회복량을 적용<br>

지정된 사용자의 시간 경과에 기반한 자동 스타미나 회복을 계산하여 적용합니다. 회복량은 마지막 회복 이후 경과 시간, 스타미나 모델에 설정된 회복 간격과 회복량을 기반으로 계산됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.ApplyStaminaByUserId(
    &stamina.ApplyStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ApplyStaminaByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->applyStaminaByUserId(
        (new ApplyStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ApplyStaminaByUserIdRequest;
import io.gs2.stamina.result.ApplyStaminaByUserIdResult;

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

try {
    ApplyStaminaByUserIdResult result = client.applyStaminaByUserId(
        new ApplyStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.ApplyStaminaByUserIdResult> asyncResult = null;
yield return client.ApplyStaminaByUserId(
    new Gs2.Gs2Stamina.Request.ApplyStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.applyStaminaByUserId(
        new Gs2Stamina.ApplyStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.apply_stamina_by_user_id(
        stamina.ApplyStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

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

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```



---

### recoverStaminaByUserId

사용자 ID를 지정하여 스타미나 회복<br>

지정된 양의 스타미나를 최대 용량까지 회복합니다. 회복으로 인해 값이 최대값을 초과하고 오버플로 모드가 활성화된 경우, 초과분은 오버플로 값으로 기록됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| recoverValue | int |  | ✓|  | 1 ~ 2147483646 | 스타미나의 회복량 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |
| overflowValue | int | 스태미나 값의 상한을 초과하여 받지 못하고 GS2-Inbox로 전송한 스태미나 값 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.RecoverStaminaByUserId(
    &stamina.RecoverStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RecoverValue: pointy.Int32(50),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
overflowValue := result.OverflowValue

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\RecoverStaminaByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->recoverStaminaByUserId(
        (new RecoverStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRecoverValue(50)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
    $overflowValue = $result->getOverflowValue();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.RecoverStaminaByUserIdRequest;
import io.gs2.stamina.result.RecoverStaminaByUserIdResult;

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

try {
    RecoverStaminaByUserIdResult result = client.recoverStaminaByUserId(
        new RecoverStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
    int overflowValue = result.getOverflowValue();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.RecoverStaminaByUserIdResult> asyncResult = null;
yield return client.RecoverStaminaByUserId(
    new Gs2.Gs2Stamina.Request.RecoverStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRecoverValue(50)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
var overflowValue = result.OverflowValue;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.recoverStaminaByUserId(
        new Gs2Stamina.RecoverStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
    const overflowValue = result.getOverflowValue();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.recover_stamina_by_user_id(
        stamina.RecoverStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_recover_value(50)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
    overflow_value = result.overflow_value
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.recover_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
overflowValue = result.overflowValue;

```

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

client = gs2('stamina')

api_result_handler = client.recover_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
overflowValue = result.overflowValue;

```



---

### raiseMaxValueByUserId

사용자 ID를 지정하여 스타미나의 최대값을 가산<br>

지정된 양만큼 스타미나의 최대 용량을 영구적으로 증가시킵니다. 레벨업 보상이나 아이템 효과 등 영구적인 스탯 상승에 사용됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| raiseValue | int |  | ✓|  | 0 ~ 2147483646 | 증가시킬 최대 스타미나 양 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.RaiseMaxValueByUserId(
    &stamina.RaiseMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RaiseValue: pointy.Int32(10),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\RaiseMaxValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->raiseMaxValueByUserId(
        (new RaiseMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRaiseValue(10)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.RaiseMaxValueByUserIdRequest;
import io.gs2.stamina.result.RaiseMaxValueByUserIdResult;

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

try {
    RaiseMaxValueByUserIdResult result = client.raiseMaxValueByUserId(
        new RaiseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRaiseValue(10)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.RaiseMaxValueByUserIdResult> asyncResult = null;
yield return client.RaiseMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.RaiseMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRaiseValue(10)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.raiseMaxValueByUserId(
        new Gs2Stamina.RaiseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRaiseValue(10)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.raise_max_value_by_user_id(
        stamina.RaiseMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_raise_value(10)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.raise_max_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    raiseValue=10,
    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;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.raise_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    raiseValue=10,
    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;
staminaModel = result.staminaModel;

```



---

### decreaseMaxValue

스타미나 최대값 감산<br>

지정된 양만큼 스타미나의 최대 용량을 감소시킵니다. 스타미나 용량에 대한 디버프나 페널티 적용에 사용할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| decreaseValue | int |  | ✓|  | 0 ~ 2147483646 | 감산할 최대 스타미나 양 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DecreaseMaxValue(
    &stamina.DecreaseMaxValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        DecreaseValue: pointy.Int32(10),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DecreaseMaxValueRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->decreaseMaxValue(
        (new DecreaseMaxValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withDecreaseValue(10)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DecreaseMaxValueRequest;
import io.gs2.stamina.result.DecreaseMaxValueResult;

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

try {
    DecreaseMaxValueResult result = client.decreaseMaxValue(
        new DecreaseMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withDecreaseValue(10)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.DecreaseMaxValueResult> asyncResult = null;
yield return client.DecreaseMaxValue(
    new Gs2.Gs2Stamina.Request.DecreaseMaxValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithDecreaseValue(10),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.decreaseMaxValue(
        new Gs2Stamina.DecreaseMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withDecreaseValue(10)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.decrease_max_value(
        stamina.DecreaseMaxValueRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_decrease_value(10)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.decrease_max_value({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    decreaseValue=10,
})

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

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.decrease_max_value_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    decreaseValue=10,
})

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

```



---

### decreaseMaxValueByUserId

사용자 ID를 지정하여 스타미나 최대값 감산<br>

지정된 사용자의 스타미나 최대 용량을 지정된 양만큼 감소시킵니다. 스타미나 용량에 대한 디버프나 페널티 적용에 사용할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| decreaseValue | int |  | ✓|  | 0 ~ 2147483646 | 감산할 최대 스타미나 양 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DecreaseMaxValueByUserId(
    &stamina.DecreaseMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        DecreaseValue: pointy.Int32(10),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DecreaseMaxValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->decreaseMaxValueByUserId(
        (new DecreaseMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withDecreaseValue(10)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DecreaseMaxValueByUserIdRequest;
import io.gs2.stamina.result.DecreaseMaxValueByUserIdResult;

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

try {
    DecreaseMaxValueByUserIdResult result = client.decreaseMaxValueByUserId(
        new DecreaseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withDecreaseValue(10)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.DecreaseMaxValueByUserIdResult> asyncResult = null;
yield return client.DecreaseMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.DecreaseMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithDecreaseValue(10)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.decreaseMaxValueByUserId(
        new Gs2Stamina.DecreaseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withDecreaseValue(10)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.decrease_max_value_by_user_id(
        stamina.DecreaseMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_decrease_value(10)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.decrease_max_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    decreaseValue=10,
    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;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.decrease_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    decreaseValue=10,
    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;
staminaModel = result.staminaModel;

```



---

### setMaxValueByUserId

사용자 ID를 지정하여 스타미나의 최대값을 갱신<br>

스타미나의 최대 용량을 지정된 값으로 설정합니다. 감사 목적으로 변경 전 스타미나 상태가 응답에 유지됩니다. 관리자에 의한 오버라이드나 특별 이벤트에서의 조정에 사용됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| maxValue | int |  | ✓|  | 1 ~ 2147483646 | 스태미나 최대값<br>StaminaModel로부터 결정되며, 옵션으로 플레이어의 GS2-Experience 랭크에 따라 MaxStaminaTable로 오버라이드되는 사용자별 스태미나 최대값입니다.<br>오버플로우가 비활성화된 경우 initialCapacity가 하한이 됩니다. 오버플로우가 활성화된 경우 maxCapacity가 상한이 됩니다.<br>자연 회복은 이 값에서 멈춥니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| old | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.SetMaxValueByUserId(
    &stamina.SetMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        MaxValue: pointy.Int32(100),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetMaxValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setMaxValueByUserId(
        (new SetMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withMaxValue(100)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetMaxValueByUserIdRequest;
import io.gs2.stamina.result.SetMaxValueByUserIdResult;

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

try {
    SetMaxValueByUserIdResult result = client.setMaxValueByUserId(
        new SetMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withMaxValue(100)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.SetMaxValueByUserIdResult> asyncResult = null;
yield return client.SetMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.SetMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithMaxValue(100)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.setMaxValueByUserId(
        new Gs2Stamina.SetMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withMaxValue(100)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.set_max_value_by_user_id(
        stamina.SetMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_max_value(100)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.set_max_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    maxValue=100,
    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;
old = result.old;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.set_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    maxValue=100,
    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;
old = result.old;
staminaModel = result.staminaModel;

```



---

### setRecoverIntervalByUserId

사용자 ID를 지정하여 스타미나 회복 간격(분)을 갱신<br>

스타미나 회복 간격을 지정된 값(분)으로 설정합니다. 감사 목적으로 변경 전 스타미나 상태가 응답에 유지됩니다. 스타미나가 자동으로 회복되는 빈도를 제어합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| recoverIntervalMinutes | int |  | ✓|  | 1 ~ 2147483646 | 스타미나 회복 간격(분) |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| old | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.SetRecoverIntervalByUserId(
    &stamina.SetRecoverIntervalByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RecoverIntervalMinutes: pointy.Int32(10),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverIntervalByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverIntervalByUserId(
        (new SetRecoverIntervalByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRecoverIntervalMinutes(10)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverIntervalByUserIdRequest;
import io.gs2.stamina.result.SetRecoverIntervalByUserIdResult;

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

try {
    SetRecoverIntervalByUserIdResult result = client.setRecoverIntervalByUserId(
        new SetRecoverIntervalByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverIntervalMinutes(10)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverIntervalByUserIdResult> asyncResult = null;
yield return client.SetRecoverIntervalByUserId(
    new Gs2.Gs2Stamina.Request.SetRecoverIntervalByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRecoverIntervalMinutes(10)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.setRecoverIntervalByUserId(
        new Gs2Stamina.SetRecoverIntervalByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverIntervalMinutes(10)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.set_recover_interval_by_user_id(
        stamina.SetRecoverIntervalByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_recover_interval_minutes(10)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.set_recover_interval_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverIntervalMinutes=10,
    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;
old = result.old;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.set_recover_interval_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverIntervalMinutes=10,
    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;
old = result.old;
staminaModel = result.staminaModel;

```



---

### setRecoverValueByUserId

사용자 ID를 지정하여 스타미나의 회복량을 설정<br>

스타미나의 회복량을 지정된 값으로 설정합니다. 감사 목적으로 변경 전 스타미나 상태가 응답에 유지됩니다. 회복 간격마다 회복되는 스타미나 양을 제어합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| recoverValue | int |  | ✓|  | 1 ~ 2147483646 | 스타미나의 회복량 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| old | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.SetRecoverValueByUserId(
    &stamina.SetRecoverValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RecoverValue: pointy.Int32(50),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverValueByUserId(
        (new SetRecoverValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRecoverValue(50)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverValueByUserIdRequest;
import io.gs2.stamina.result.SetRecoverValueByUserIdResult;

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

try {
    SetRecoverValueByUserIdResult result = client.setRecoverValueByUserId(
        new SetRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverValueByUserIdResult> asyncResult = null;
yield return client.SetRecoverValueByUserId(
    new Gs2.Gs2Stamina.Request.SetRecoverValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRecoverValue(50)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.setRecoverValueByUserId(
        new Gs2Stamina.SetRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.set_recover_value_by_user_id(
        stamina.SetRecoverValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_recover_value(50)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.set_recover_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.set_recover_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

```



---

### setMaxValueByStatus

GS2-Experience의 스테이터스를 사용하여 스타미나의 최대값을 갱신<br>

서명된 GS2-Experience 스테이터스의 랭크 값을 기반으로 스타미나의 최대 용량을 설정합니다. 서명된 스테이터스의 바디와 서명을 지정된 키로 검증한 후, 랭크 값을 사용하여 최대 스타미나 테이블에서 대응하는 최대 스타미나를 조회합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024자 | 암호화 키 GRN |
| signedStatusBody | string |  | ✓|  |  ~ 524288자 | 서명 대상인 GS2-Experience 스테이터스의 바디 |
| signedStatusSignature | string |  | ✓|  |  ~ 128자 | GS2-Experience 스테이터스의 서명 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| old | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.SetMaxValueByStatus(
    &stamina.SetMaxValueByStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        KeyId: pointy.String("key-0001"),
        SignedStatusBody: pointy.String("statusBody..."),
        SignedStatusSignature: pointy.String("statusSignature..."),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetMaxValueByStatusRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setMaxValueByStatus(
        (new SetMaxValueByStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withKeyId("key-0001")
            ->withSignedStatusBody("statusBody...")
            ->withSignedStatusSignature("statusSignature...")
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetMaxValueByStatusRequest;
import io.gs2.stamina.result.SetMaxValueByStatusResult;

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

try {
    SetMaxValueByStatusResult result = client.setMaxValueByStatus(
        new SetMaxValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.SetMaxValueByStatusResult> asyncResult = null;
yield return client.SetMaxValueByStatus(
    new Gs2.Gs2Stamina.Request.SetMaxValueByStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithKeyId("key-0001")
        .WithSignedStatusBody("statusBody...")
        .WithSignedStatusSignature("statusSignature..."),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.setMaxValueByStatus(
        new Gs2Stamina.SetMaxValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.set_max_value_by_status(
        stamina.SetMaxValueByStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_key_id('key-0001')
            .with_signed_status_body('statusBody...')
            .with_signed_status_signature('statusSignature...')
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.set_max_value_by_status({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

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

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.set_max_value_by_status_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

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

```



---

### setRecoverIntervalByStatus

GS2-Experience의 스테이터스를 사용하여 스타미나의 회복 간격을 갱신<br>

서명된 GS2-Experience 스테이터스의 랭크 값을 기반으로 스타미나의 회복 간격을 설정합니다. 서명된 스테이터스의 바디와 서명을 지정된 키로 검증한 후, 랭크 값을 사용하여 회복 간격 테이블에서 대응하는 회복 간격을 조회합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024자 | 암호화 키 GRN |
| signedStatusBody | string |  | ✓|  |  ~ 524288자 | 서명 대상인 GS2-Experience 스테이터스의 바디 |
| signedStatusSignature | string |  | ✓|  |  ~ 128자 | GS2-Experience 스테이터스의 서명 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| old | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.SetRecoverIntervalByStatus(
    &stamina.SetRecoverIntervalByStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        KeyId: pointy.String("key-0001"),
        SignedStatusBody: pointy.String("statusBody..."),
        SignedStatusSignature: pointy.String("statusSignature..."),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverIntervalByStatusRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverIntervalByStatus(
        (new SetRecoverIntervalByStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withKeyId("key-0001")
            ->withSignedStatusBody("statusBody...")
            ->withSignedStatusSignature("statusSignature...")
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverIntervalByStatusRequest;
import io.gs2.stamina.result.SetRecoverIntervalByStatusResult;

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

try {
    SetRecoverIntervalByStatusResult result = client.setRecoverIntervalByStatus(
        new SetRecoverIntervalByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverIntervalByStatusResult> asyncResult = null;
yield return client.SetRecoverIntervalByStatus(
    new Gs2.Gs2Stamina.Request.SetRecoverIntervalByStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithKeyId("key-0001")
        .WithSignedStatusBody("statusBody...")
        .WithSignedStatusSignature("statusSignature..."),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.setRecoverIntervalByStatus(
        new Gs2Stamina.SetRecoverIntervalByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.set_recover_interval_by_status(
        stamina.SetRecoverIntervalByStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_key_id('key-0001')
            .with_signed_status_body('statusBody...')
            .with_signed_status_signature('statusSignature...')
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.set_recover_interval_by_status({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

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

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.set_recover_interval_by_status_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

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

```



---

### setRecoverValueByStatus

GS2-Experience의 스테이터스를 사용하여 스타미나의 회복량을 갱신<br>

서명된 GS2-Experience 스테이터스의 랭크 값을 기반으로 스타미나의 회복량을 설정합니다. 서명된 스테이터스의 바디와 서명을 지정된 키로 검증한 후, 랭크 값을 사용하여 회복량 테이블에서 대응하는 회복량을 조회합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024자 | 암호화 키 GRN |
| signedStatusBody | string |  | ✓|  |  ~ 524288자 | 서명 대상인 GS2-Experience 스테이터스의 바디 |
| signedStatusSignature | string |  | ✓|  |  ~ 128자 | GS2-Experience 스테이터스의 서명 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |
| old | [Stamina](#stamina) | 스타미나 |
| staminaModel | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.SetRecoverValueByStatus(
    &stamina.SetRecoverValueByStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        KeyId: pointy.String("key-0001"),
        SignedStatusBody: pointy.String("statusBody..."),
        SignedStatusSignature: pointy.String("statusSignature..."),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverValueByStatusRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverValueByStatus(
        (new SetRecoverValueByStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withKeyId("key-0001")
            ->withSignedStatusBody("statusBody...")
            ->withSignedStatusSignature("statusSignature...")
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverValueByStatusRequest;
import io.gs2.stamina.result.SetRecoverValueByStatusResult;

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

try {
    SetRecoverValueByStatusResult result = client.setRecoverValueByStatus(
        new SetRecoverValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverValueByStatusResult> asyncResult = null;
yield return client.SetRecoverValueByStatus(
    new Gs2.Gs2Stamina.Request.SetRecoverValueByStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithKeyId("key-0001")
        .WithSignedStatusBody("statusBody...")
        .WithSignedStatusSignature("statusSignature..."),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.setRecoverValueByStatus(
        new Gs2Stamina.SetRecoverValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.set_recover_value_by_status(
        stamina.SetRecoverValueByStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_key_id('key-0001')
            .with_signed_status_body('statusBody...')
            .with_signed_status_signature('statusSignature...')
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.set_recover_value_by_status({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

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

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

```

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

client = gs2('stamina')

api_result_handler = client.set_recover_value_by_status_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

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

```



---

### deleteStaminaByUserId

사용자 ID를 지정하여 스타미나 삭제<br>

지정된 사용자의 스타미나 리소스를 완전히 삭제합니다. 현재값, 회복 설정, 오버플로량을 포함한 스타미나 레코드가 완전히 삭제됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 삭제한 스태미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DeleteStaminaByUserId(
    &stamina.DeleteStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteStaminaByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteStaminaByUserId(
        (new DeleteStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteStaminaByUserIdRequest;
import io.gs2.stamina.result.DeleteStaminaByUserIdResult;

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

try {
    DeleteStaminaByUserIdResult result = client.deleteStaminaByUserId(
        new DeleteStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteStaminaByUserIdResult> asyncResult = null;
yield return client.DeleteStaminaByUserId(
    new Gs2.Gs2Stamina.Request.DeleteStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.deleteStaminaByUserId(
        new Gs2Stamina.DeleteStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.delete_stamina_by_user_id(
        stamina.DeleteStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

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

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaValue

스타미나 현재값을 검증<br>

현재 스타미나 값이 지정된 조건(미만, 이하, 초과, 이상, 일치, 불일치)을 지정된 임계값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 현재값이 지정값 미만임 / lessEqual: 현재값이 지정값 이하임 / greater: 현재값이 지정값을 초과함 / greaterEqual: 현재값이 지정값 이상임 / equal: 현재값이 지정값과 일치함 / notEqual: 현재값이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 현재값 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaValue(
    &stamina.VerifyStaminaValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaValueRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaValue(
        (new VerifyStaminaValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaValueRequest;
import io.gs2.stamina.result.VerifyStaminaValueResult;

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

try {
    VerifyStaminaValueResult result = client.verifyStaminaValue(
        new VerifyStaminaValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaValueResult> asyncResult = null;
yield return client.VerifyStaminaValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaValue(
        new Gs2Stamina.VerifyStaminaValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_value(
        stamina.VerifyStaminaValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaValueByUserId

사용자 ID를 지정하여 스타미나 현재값을 검증<br>

지정된 사용자의 현재 스타미나 값이 지정된 조건을 지정된 임계값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 현재값이 지정값 미만임 / lessEqual: 현재값이 지정값 이하임 / greater: 현재값이 지정값을 초과함 / greaterEqual: 현재값이 지정값 이상임 / equal: 현재값이 지정값과 일치함 / notEqual: 현재값이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 현재값 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaValueByUserId(
    &stamina.VerifyStaminaValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaValueByUserId(
        (new VerifyStaminaValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaValueByUserIdResult;

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

try {
    VerifyStaminaValueByUserIdResult result = client.verifyStaminaValueByUserId(
        new VerifyStaminaValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaValueByUserId(
        new Gs2Stamina.VerifyStaminaValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_value_by_user_id(
        stamina.VerifyStaminaValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaMaxValue

스태미나 최댓값 검증<br>

스태미나의 최대 용량(버프에 의한 변경 포함)이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 최댓값이 지정값 미만임 / lessEqual: 최댓값이 지정값 이하임 / greater: 최댓값이 지정값을 초과함 / greaterEqual: 최댓값이 지정값 이상임 / equal: 최댓값이 지정값과 일치함 / notEqual: 최댓값이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 최대값 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaMaxValue(
    &stamina.VerifyStaminaMaxValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaMaxValueRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaMaxValue(
        (new VerifyStaminaMaxValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaMaxValueRequest;
import io.gs2.stamina.result.VerifyStaminaMaxValueResult;

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

try {
    VerifyStaminaMaxValueResult result = client.verifyStaminaMaxValue(
        new VerifyStaminaMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueResult> asyncResult = null;
yield return client.VerifyStaminaMaxValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaMaxValue(
        new Gs2Stamina.VerifyStaminaMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_max_value(
        stamina.VerifyStaminaMaxValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_max_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_max_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaMaxValueByUserId

사용자 ID를 지정하여 스태미나 최댓값 검증<br>

지정된 사용자의 스태미나 최대 용량(버프에 의한 변경 포함)이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 최댓값이 지정값 미만임 / lessEqual: 최댓값이 지정값 이하임 / greater: 최댓값이 지정값을 초과함 / greaterEqual: 최댓값이 지정값 이상임 / equal: 최댓값이 지정값과 일치함 / notEqual: 최댓값이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 최대값 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaMaxValueByUserId(
    &stamina.VerifyStaminaMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaMaxValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaMaxValueByUserId(
        (new VerifyStaminaMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaMaxValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaMaxValueByUserIdResult;

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

try {
    VerifyStaminaMaxValueByUserIdResult result = client.verifyStaminaMaxValueByUserId(
        new VerifyStaminaMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaMaxValueByUserId(
        new Gs2Stamina.VerifyStaminaMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_max_value_by_user_id(
        stamina.VerifyStaminaMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_max_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaRecoverIntervalMinutes

스태미나 회복 간격(분) 검증<br>

스태미나의 회복 간격(분)이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 회복 속도가 지정값 미만임 / lessEqual: 회복 속도가 지정값 이하임 / greater: 회복 속도가 지정값을 초과함 / greaterEqual: 회복 속도가 지정값 이상임 / equal: 회복 속도가 지정값과 일치함 / notEqual: 회복 속도가 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 회복 속도 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaRecoverIntervalMinutes(
    &stamina.VerifyStaminaRecoverIntervalMinutesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverIntervalMinutesRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverIntervalMinutes(
        (new VerifyStaminaRecoverIntervalMinutesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverIntervalMinutesRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverIntervalMinutesResult;

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

try {
    VerifyStaminaRecoverIntervalMinutesResult result = client.verifyStaminaRecoverIntervalMinutes(
        new VerifyStaminaRecoverIntervalMinutesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesResult> asyncResult = null;
yield return client.VerifyStaminaRecoverIntervalMinutes(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaRecoverIntervalMinutes(
        new Gs2Stamina.VerifyStaminaRecoverIntervalMinutesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_recover_interval_minutes(
        stamina.VerifyStaminaRecoverIntervalMinutesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_recover_interval_minutes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_interval_minutes_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaRecoverIntervalMinutesByUserId

사용자 ID를 지정하여 스태미나 회복 간격(분) 검증<br>

지정된 사용자의 스태미나 회복 간격(분)이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 회복 속도가 지정값 미만임 / lessEqual: 회복 속도가 지정값 이하임 / greater: 회복 속도가 지정값을 초과함 / greaterEqual: 회복 속도가 지정값 이상임 / equal: 회복 속도가 지정값과 일치함 / notEqual: 회복 속도가 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 회복 속도 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaRecoverIntervalMinutesByUserId(
    &stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverIntervalMinutesByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverIntervalMinutesByUserId(
        (new VerifyStaminaRecoverIntervalMinutesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverIntervalMinutesByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverIntervalMinutesByUserIdResult;

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

try {
    VerifyStaminaRecoverIntervalMinutesByUserIdResult result = client.verifyStaminaRecoverIntervalMinutesByUserId(
        new VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaRecoverIntervalMinutesByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaRecoverIntervalMinutesByUserId(
        new Gs2Stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_recover_interval_minutes_by_user_id(
        stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_recover_interval_minutes_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_interval_minutes_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaRecoverValue

스태미나 회복량 검증<br>

스태미나의 회복량(버프에 의한 변경 포함)이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 회복량이 지정값 미만임 / lessEqual: 회복량이 지정값 이하임 / greater: 회복량이 지정값을 초과함 / greaterEqual: 회복량이 지정값 이상임 / equal: 회복량이 지정값과 일치함 / notEqual: 회복량이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 회복량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaRecoverValue(
    &stamina.VerifyStaminaRecoverValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverValueRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverValue(
        (new VerifyStaminaRecoverValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverValueRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverValueResult;

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

try {
    VerifyStaminaRecoverValueResult result = client.verifyStaminaRecoverValue(
        new VerifyStaminaRecoverValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueResult> asyncResult = null;
yield return client.VerifyStaminaRecoverValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaRecoverValue(
        new Gs2Stamina.VerifyStaminaRecoverValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_recover_value(
        stamina.VerifyStaminaRecoverValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_recover_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaRecoverValueByUserId

사용자 ID를 지정하여 스태미나 회복량 검증<br>

지정된 사용자의 스태미나 회복량(버프에 의한 변경 포함)이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 회복량이 지정값 미만임 / lessEqual: 회복량이 지정값 이하임 / greater: 회복량이 지정값을 초과함 / greaterEqual: 회복량이 지정값 이상임 / equal: 회복량이 지정값과 일치함 / notEqual: 회복량이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 회복량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaRecoverValueByUserId(
    &stamina.VerifyStaminaRecoverValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverValueByUserId(
        (new VerifyStaminaRecoverValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverValueByUserIdResult;

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

try {
    VerifyStaminaRecoverValueByUserIdResult result = client.verifyStaminaRecoverValueByUserId(
        new VerifyStaminaRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaRecoverValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaRecoverValueByUserId(
        new Gs2Stamina.VerifyStaminaRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_recover_value_by_user_id(
        stamina.VerifyStaminaRecoverValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_recover_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaOverflowValue

스태미나 오버플로우량 검증<br>

스태미나의 오버플로우량(최대 용량을 초과한 잉여 스태미나)이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 오버플로우량이 지정값 미만임 / lessEqual: 오버플로우량이 지정값 이하임 / greater: 오버플로우량이 지정값을 초과함 / greaterEqual: 오버플로우량이 지정값 이상임 / equal: 오버플로우량이 지정값과 일치함 / notEqual: 오버플로우량이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 오버플로우량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaOverflowValue(
    &stamina.VerifyStaminaOverflowValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaOverflowValueRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaOverflowValue(
        (new VerifyStaminaOverflowValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaOverflowValueRequest;
import io.gs2.stamina.result.VerifyStaminaOverflowValueResult;

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

try {
    VerifyStaminaOverflowValueResult result = client.verifyStaminaOverflowValue(
        new VerifyStaminaOverflowValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueResult> asyncResult = null;
yield return client.VerifyStaminaOverflowValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaOverflowValue(
        new Gs2Stamina.VerifyStaminaOverflowValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_overflow_value(
        stamina.VerifyStaminaOverflowValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_overflow_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_overflow_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyStaminaOverflowValueByUserId

사용자 ID를 지정하여 스태미나 오버플로우량 검증<br>

지정된 사용자의 스태미나 오버플로우량이 지정된 조건을 지정된 임곗값에 대해 충족하는지, 상태를 변경하지 않고 검증합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>이 스태미나 인스턴스의 회복 파라미터, 용량, 테이블 참조를 정의하는 StaminaModel의 이름입니다.<br>사용자별 스태미나 상태를 대응하는 모델 정의와 연결합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 오버플로우량이 지정값 미만임 / lessEqual: 오버플로우량이 지정값 이하임 / greater: 오버플로우량이 지정값을 초과함 / greaterEqual: 오버플로우량이 지정값 이상임 / equal: 오버플로우량이 지정값과 일치함 / notEqual: 오버플로우량이 지정값과 일치하지 않음 /  |
| value | int |  | ✓|  | 0 ~ 2147483646 | 오버플로우량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Stamina](#stamina) | 스타미나 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.VerifyStaminaOverflowValueByUserId(
    &stamina.VerifyStaminaOverflowValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaOverflowValueByUserIdRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaOverflowValueByUserId(
        (new VerifyStaminaOverflowValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaOverflowValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaOverflowValueByUserIdResult;

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

try {
    VerifyStaminaOverflowValueByUserIdResult result = client.verifyStaminaOverflowValueByUserId(
        new VerifyStaminaOverflowValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaOverflowValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.verifyStaminaOverflowValueByUserId(
        new Gs2Stamina.VerifyStaminaOverflowValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.verify_stamina_overflow_value_by_user_id(
        stamina.VerifyStaminaOverflowValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.verify_stamina_overflow_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.verify_stamina_overflow_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### describeStaminaModels

스타미나 모델 목록 취득<br>

활성화된 스타미나 모델의 목록을 취득합니다. 각 스타미나 모델은 회복 간격, 회복량, 초기 용량, 오버플로 설정, 그리고 레벨 기반 스타미나 파라미터용 옵션 조회 테이블을 정의합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;StaminaModel&gt;](#staminamodel) | 스타미나 모델의 리스트 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DescribeStaminaModels(
    &stamina.DescribeStaminaModelsRequest {
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminaModelsRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeStaminaModels(
        (new DescribeStaminaModelsRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminaModelsRequest;
import io.gs2.stamina.result.DescribeStaminaModelsResult;

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

try {
    DescribeStaminaModelsResult result = client.describeStaminaModels(
        new DescribeStaminaModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<StaminaModel> 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminaModelsResult> asyncResult = null;
yield return client.DescribeStaminaModels(
    new Gs2.Gs2Stamina.Request.DescribeStaminaModelsRequest()
        .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 Gs2Stamina from '@/gs2/stamina';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.describe_stamina_models(
        stamina.DescribeStaminaModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.describe_stamina_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('stamina')

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

```



---

### getStaminaModel

스타미나 모델 취득<br>

회복 간격, 회복량, 초기 용량, 오버플로 설정, 관련 조회 테이블 이름을 포함한 지정된 스타미나 모델을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>스태미나 모델 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [StaminaModel](#staminamodel) | 스타미나 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetStaminaModel(
    &stamina.GetStaminaModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaModelRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStaminaModel(
        (new GetStaminaModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaModelRequest;
import io.gs2.stamina.result.GetStaminaModelResult;

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

try {
    GetStaminaModelResult result = client.getStaminaModel(
        new GetStaminaModelRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    StaminaModel 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaModelResult> asyncResult = null;
yield return client.GetStaminaModel(
    new Gs2.Gs2Stamina.Request.GetStaminaModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.getStaminaModel(
        new Gs2Stamina.GetStaminaModelRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_stamina_model(
        stamina.GetStaminaModelRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.get_stamina_model({
    namespaceName="namespace-0001",
    staminaName="stamina-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('stamina')

api_result_handler = client.get_stamina_model_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
})

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

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

result = api_result.result
item = result.item;

```



---

### exportMaster

스태미나 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보내기<br>

현재 등록되어 있는 스태미나 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보냅니다. 내보낸 데이터에는 스태미나 모델, 스태미나 최댓값 테이블, 회복 간격 테이블, 회복량 테이블의 모든 정의가 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentStaminaMaster](#currentstaminamaster) | 활성화 가능한 스태미나 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

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

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

$session->open();

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

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

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


```

**GS2-Script**
```lua

client = gs2('stamina')

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

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;

```



---

### getCurrentStaminaMaster

현재 활성화된 스태미나 모델 마스터 데이터 가져오기<br>

사용 중인 모든 스태미나 모델, 스태미나 최댓값 테이블, 회복 간격 테이블, 회복량 테이블의 정의를 포함하여, 현재 활성화된 스태미나 모델 마스터 데이터를 가져옵니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentStaminaMaster](#currentstaminamaster) | 현재 활성화된 스태미나 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetCurrentStaminaMaster(
    &stamina.GetCurrentStaminaMasterRequest {
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetCurrentStaminaMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getCurrentStaminaMaster(
        (new GetCurrentStaminaMasterRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetCurrentStaminaMasterRequest;
import io.gs2.stamina.result.GetCurrentStaminaMasterResult;

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

try {
    GetCurrentStaminaMasterResult result = client.getCurrentStaminaMaster(
        new GetCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentStaminaMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetCurrentStaminaMasterResult> asyncResult = null;
yield return client.GetCurrentStaminaMaster(
    new Gs2.Gs2Stamina.Request.GetCurrentStaminaMasterRequest()
        .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 Gs2Stamina from '@/gs2/stamina';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_current_stamina_master(
        stamina.GetCurrentStaminaMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.get_current_stamina_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('stamina')

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

```



---

### preUpdateCurrentStaminaMaster

현재 활성화된 스태미나 모델 마스터 데이터 갱신(3단계 버전)<br>

1MB를 초과하는 마스터 데이터를 업로드하는 경우, 3단계로 나누어 갱신을 수행합니다.<br>
1. 이 API를 실행하여 업로드용 토큰과 URL을 가져옵니다.<br>
2. 가져온 URL에 마스터 데이터를 업로드합니다.<br>
3. UpdateCurrentStaminaMaster에 업로드로 얻은 토큰을 전달하여 실행하고, 마스터 데이터를 반영합니다.


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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentStaminaMaster(
    &stamina.PreUpdateCurrentStaminaMasterRequest {
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\PreUpdateCurrentStaminaMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentStaminaMaster(
        (new PreUpdateCurrentStaminaMasterRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.PreUpdateCurrentStaminaMasterRequest;
import io.gs2.stamina.result.PreUpdateCurrentStaminaMasterResult;

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

try {
    PreUpdateCurrentStaminaMasterResult result = client.preUpdateCurrentStaminaMaster(
        new PreUpdateCurrentStaminaMasterRequest()
            .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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.PreUpdateCurrentStaminaMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentStaminaMaster(
    new Gs2.Gs2Stamina.Request.PreUpdateCurrentStaminaMasterRequest()
        .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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.preUpdateCurrentStaminaMaster(
        new Gs2Stamina.PreUpdateCurrentStaminaMasterRequest()
            .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 stamina

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

try:
    result = client.pre_update_current_stamina_master(
        stamina.PreUpdateCurrentStaminaMasterRequest()
            .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('stamina')

api_result = client.pre_update_current_stamina_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('stamina')

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

```



---

### updateCurrentStaminaMaster

현재 활성화된 스태미나 모델의 마스터 데이터를 업데이트<br>

현재 활성화된 스태미나 모델 마스터 데이터를 업데이트합니다. 대용량 마스터 데이터에 대응하기 위해 직접 업데이트 모드와 사전 업로드 모드를 모두 지원합니다. 사전 업로드 모드에서는 PreUpdate API로 취득한 업로드 토큰을 사용하여 설정을 읽어들입니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| mode | 문자열 열거형<br>enum {<br>"direct",<br>"preUpload"<br>}<br> |  | | "direct" |  | 업데이트 모드direct: 마스터 데이터를 직접 업데이트 / preUpload: 마스터 데이터를 업로드한 후 업데이트 /  |
| settings | string | {mode} == "direct" | ✓※|  |  ~ 5242880 바이트 (5MB) | 마스터 데이터<br>※ mode이(가) "direct" 이면 필수 |
| uploadToken | string | {mode} == "preUpload" | ✓※|  |  ~ 1024자 | 사전 업로드로 획득한 토큰<br>업로드한 마스터 데이터를 적용하기 위해 사용됩니다.<br>※ mode이(가) "preUpload" 이면 필수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentStaminaMaster](#currentstaminamaster) | 업데이트된 현재 활성화된 스태미나 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentStaminaMaster(
    &stamina.UpdateCurrentStaminaMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}"),
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateCurrentStaminaMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateCurrentStaminaMaster(
        (new UpdateCurrentStaminaMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateCurrentStaminaMasterRequest;
import io.gs2.stamina.result.UpdateCurrentStaminaMasterResult;

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

try {
    UpdateCurrentStaminaMasterResult result = client.updateCurrentStaminaMaster(
        new UpdateCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    CurrentStaminaMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterResult> asyncResult = null;
yield return client.UpdateCurrentStaminaMaster(
    new Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
        .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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.updateCurrentStaminaMaster(
        new Gs2Stamina.UpdateCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.update_current_stamina_master(
        stamina.UpdateCurrentStaminaMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2019-02-14",\n  "staminaModels": [\n    {\n      "name": "quest",\n      "metadata": "QUEST",\n      "recoverIntervalMinutes": 15,\n      "recoverValue": 1,\n      "initialCapacity": 50,\n      "isOverflow": true,\n      "maxCapacity": 999,\n      "maxStaminaTable": {\n        "name": "playerLevel",\n        "metadata": "PLAYER_LEVEL",\n        "experienceModelId": "playerLevel",\n        "values": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      "recoverIntervalTable": {\n        "name": "staminaRecoverInterval",\n        "metadata": "STAMINA_RECOVER_INTERVAL",\n        "experienceModelId": "playerLevel",\n        "values": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      "recoverValueTable": {\n        "name": "staminaRecoverValue",\n        "metadata": "STAMINA_RECOVER_VALUE",\n        "experienceModelId": "playerLevel",\n        "values": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      "name": "raidBattle",\n      "metadata": "RAID_BATTLE",\n      "recoverIntervalMinutes": 60,\n      "recoverValue": 1,\n      "initialCapacity": 10,\n      "isOverflow": false\n    },\n    {\n      "name": "special",\n      "metadata": "SPECIAL",\n      "recoverIntervalMinutes": 30,\n      "recoverValue": 3,\n      "initialCapacity": 100,\n      "isOverflow": true,\n      "maxCapacity": 999,\n      "maxStaminaTable": {\n        "name": "special",\n        "metadata": "SPECIAL",\n        "experienceModelId": "special",\n        "values": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.update_current_stamina_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}",
    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('stamina')

api_result_handler = client.update_current_stamina_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}",
    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;

```



---

### updateCurrentStaminaMasterFromGitHub

현재 활성화된 스태미나 모델의 마스터 데이터를 GitHub에서 업데이트<br>

지정된 체크아웃 설정을 사용하여 GitHub 리포지토리에서 마스터 데이터를 체크아웃하고, 현재 활성화된 스태미나 모델 마스터 데이터를 업데이트합니다. GitHub와의 인증에는 키 서비스를 통해 API 키가 복호화되어 사용됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| checkoutSetting | [GitHubCheckoutSetting](#githubcheckoutsetting) |  | ✓|  |  | GitHub에서 마스터 데이터를 체크아웃하는 설정 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentStaminaMaster](#currentstaminamaster) | 업데이트된 현재 활성화된 스태미나 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentStaminaMasterFromGitHub(
    &stamina.UpdateCurrentStaminaMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateCurrentStaminaMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateCurrentStaminaMasterFromGitHub(
        (new UpdateCurrentStaminaMasterFromGitHubRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateCurrentStaminaMasterFromGitHubRequest;
import io.gs2.stamina.result.UpdateCurrentStaminaMasterFromGitHubResult;

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

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

AsyncResult<Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentStaminaMasterFromGitHub(
    new Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.updateCurrentStaminaMasterFromGitHub(
        new Gs2Stamina.UpdateCurrentStaminaMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Stamina.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 stamina

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

try:
    result = client.update_current_stamina_master_from_git_hub(
        stamina.UpdateCurrentStaminaMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(stamina.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('stamina')

api_result = client.update_current_stamina_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('stamina')

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

```



---

### describeStaminaModelMasters

스태미나 모델 마스터 목록 가져오기<br>

스태미나 모델 마스터의 페이지네이션 리스트를 가져옵니다. 이름의 접두사로 필터링할 수 있습니다. 스태미나 모델 마스터는 회복 간격, 회복량, 초기 용량, 오버플로우 설정, 선택적 조회 테이블 연관 정보를 정의합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 스태미나 모델 이름의 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;StaminaModelMaster&gt;](#staminamodelmaster) | 스태미나 모델 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DescribeStaminaModelMasters(
    &stamina.DescribeStaminaModelMastersRequest {
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminaModelMastersRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeStaminaModelMasters(
        (new DescribeStaminaModelMastersRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminaModelMastersRequest;
import io.gs2.stamina.result.DescribeStaminaModelMastersResult;

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

try {
    DescribeStaminaModelMastersResult result = client.describeStaminaModelMasters(
        new DescribeStaminaModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<StaminaModelMaster> 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminaModelMastersResult> asyncResult = null;
yield return client.DescribeStaminaModelMasters(
    new Gs2.Gs2Stamina.Request.DescribeStaminaModelMastersRequest()
        .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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.describeStaminaModelMasters(
        new Gs2Stamina.DescribeStaminaModelMastersRequest()
            .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 stamina

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

try:
    result = client.describe_stamina_model_masters(
        stamina.DescribeStaminaModelMastersRequest()
            .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('stamina')

api_result = client.describe_stamina_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('stamina')

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

```



---

### createStaminaModelMaster

스태미나 모델 마스터 신규 생성<br>

회복 간격(분), 회복량, 초기 용량, 오버플로우 모드 설정, 최대 용량, 그리고 레벨 기반 파라미터 스케일링을 위한 스태미나 최댓값 테이블, 회복 간격 테이블, 회복량 테이블에 대한 선택적 연관 정보를 가진 새로운 스태미나 모델 마스터를 생성합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>스태미나 모델 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| recoverIntervalMinutes | int |  | ✓|  | 0 ~ 2147483646 | 회복 간격(분)<br>스태미나 회복 틱의 간격(분 단위)입니다.<br>이 간격이 경과할 때마다 플레이어의 스태미나가 회복량만큼 증가합니다.<br>RecoverIntervalTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>0으로 설정하면 시간 기반 자동 회복이 비활성화됩니다. |
| recoverValue | int |  | | 1 | 0 ~ 2147483646 | 회복량<br>회복 틱마다 회복되는 스태미나의 양입니다.<br>회복 간격이 경과할 때마다 최대값에 도달할 때까지 이 값만큼 스태미나가 증가합니다.<br>RecoverValueTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>기본값은 1입니다. |
| initialCapacity | int |  | ✓|  | 0 ~ 2147483646 | 최대값의 초기값<br>모든 플레이어에 대한 기본 스태미나 최대값입니다.<br>오버플로우가 비활성화된 경우, 사용자별 최대값의 하한으로 작용합니다.<br>MaxStaminaTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다. |
| isOverflow | bool |  | ✓|  |  | 오버플로우 가능 여부<br>아이템 사용 등의 수단으로 스태미나가 초기 최대값을 초과할 수 있는지 여부입니다.<br>활성화된 경우, 스태미나는 initialCapacity를 초과하여 maxCapacity까지 설정할 수 있습니다. 자연 회복은 일반적인 최대값에서 정지합니다.<br>비활성화된 경우, 사용자별 최대값은 initialCapacity 이상으로 제한됩니다. |
| maxCapacity | int | {isOverflow} == true | ✓※|  | 0 ~ 2147483646 | 오버플로우 시 최대값<br>오버플로우 활성화 시 스태미나의 절대 상한값입니다.<br>오버플로우 상태에서도 스태미나는 이 값을 초과할 수 없습니다. isOverflow가 true인 경우에만 표시됩니다.<br>※ isOverflow이(가) true 이면 필수 |
| maxStaminaTableName | string |  | |  |  ~ 128자 | 스태미나 최대값 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 스태미나 최대값을 동적으로 결정하는 MaxStaminaTable의 이름입니다.<br>설정 시, 플레이어의 최대 스태미나는 현재 랭크 인덱스로 테이블에서 참조되며, initialCapacity를 오버라이드합니다. |
| recoverIntervalTableName | string |  | |  |  ~ 128자 | 회복 간격 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 회복 간격을 동적으로 결정하는 RecoverIntervalTable의 이름입니다.<br>설정 시, 플레이어의 회복 간격은 테이블에서 참조되며, recoverIntervalMinutes를 오버라이드합니다. |
| recoverValueTableName | string |  | |  |  ~ 128자 | 회복량 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 회복량을 동적으로 결정하는 RecoverValueTable의 이름입니다.<br>설정 시, 플레이어의 회복량은 테이블에서 참조되며, recoverValue를 오버라이드합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [StaminaModelMaster](#staminamodelmaster) | 생성한 스태미나 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateStaminaModelMaster(
    &stamina.CreateStaminaModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("stamina-0001"),
        Description: nil,
        Metadata: nil,
        RecoverIntervalMinutes: pointy.Int32(15),
        RecoverValue: nil,
        InitialCapacity: pointy.Int32(50),
        IsOverflow: pointy.Bool(false),
        MaxCapacity: nil,
        MaxStaminaTableName: pointy.String("maxStaminaTable-0001"),
        RecoverIntervalTableName: pointy.String("recoverIntervalTable-0001"),
        RecoverValueTableName: pointy.String("recoverValueTable-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateStaminaModelMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createStaminaModelMaster(
        (new CreateStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("stamina-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withRecoverIntervalMinutes(15)
            ->withRecoverValue(null)
            ->withInitialCapacity(50)
            ->withIsOverflow(false)
            ->withMaxCapacity(null)
            ->withMaxStaminaTableName("maxStaminaTable-0001")
            ->withRecoverIntervalTableName("recoverIntervalTable-0001")
            ->withRecoverValueTableName("recoverValueTable-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateStaminaModelMasterRequest;
import io.gs2.stamina.result.CreateStaminaModelMasterResult;

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

try {
    CreateStaminaModelMasterResult result = client.createStaminaModelMaster(
        new CreateStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("stamina-0001")
            .withDescription(null)
            .withMetadata(null)
            .withRecoverIntervalMinutes(15)
            .withRecoverValue(null)
            .withInitialCapacity(50)
            .withIsOverflow(false)
            .withMaxCapacity(null)
            .withMaxStaminaTableName("maxStaminaTable-0001")
            .withRecoverIntervalTableName("recoverIntervalTable-0001")
            .withRecoverValueTableName("recoverValueTable-0001")
    );
    StaminaModelMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateStaminaModelMasterResult> asyncResult = null;
yield return client.CreateStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.CreateStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("stamina-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithRecoverIntervalMinutes(15)
        .WithRecoverValue(null)
        .WithInitialCapacity(50)
        .WithIsOverflow(false)
        .WithMaxCapacity(null)
        .WithMaxStaminaTableName("maxStaminaTable-0001")
        .WithRecoverIntervalTableName("recoverIntervalTable-0001")
        .WithRecoverValueTableName("recoverValueTable-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.createStaminaModelMaster(
        new Gs2Stamina.CreateStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("stamina-0001")
            .withDescription(null)
            .withMetadata(null)
            .withRecoverIntervalMinutes(15)
            .withRecoverValue(null)
            .withInitialCapacity(50)
            .withIsOverflow(false)
            .withMaxCapacity(null)
            .withMaxStaminaTableName("maxStaminaTable-0001")
            .withRecoverIntervalTableName("recoverIntervalTable-0001")
            .withRecoverValueTableName("recoverValueTable-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.create_stamina_model_master(
        stamina.CreateStaminaModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('stamina-0001')
            .with_description(None)
            .with_metadata(None)
            .with_recover_interval_minutes(15)
            .with_recover_value(None)
            .with_initial_capacity(50)
            .with_is_overflow(False)
            .with_max_capacity(None)
            .with_max_stamina_table_name('maxStaminaTable-0001')
            .with_recover_interval_table_name('recover_interval_table-0001')
            .with_recover_value_table_name('recoverValueTable-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.create_stamina_model_master({
    namespaceName="namespace-0001",
    name="stamina-0001",
    description=nil,
    metadata=nil,
    recoverIntervalMinutes=15,
    recoverValue=nil,
    initialCapacity=50,
    isOverflow=false,
    maxCapacity=nil,
    maxStaminaTableName="maxStaminaTable-0001",
    recoverIntervalTableName="recoverIntervalTable-0001",
    recoverValueTableName="recoverValueTable-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('stamina')

api_result_handler = client.create_stamina_model_master_async({
    namespaceName="namespace-0001",
    name="stamina-0001",
    description=nil,
    metadata=nil,
    recoverIntervalMinutes=15,
    recoverValue=nil,
    initialCapacity=50,
    isOverflow=false,
    maxCapacity=nil,
    maxStaminaTableName="maxStaminaTable-0001",
    recoverIntervalTableName="recoverIntervalTable-0001",
    recoverValueTableName="recoverValueTable-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;

```



---

### getStaminaModelMaster

스태미나 모델 마스터 가져오기<br>

회복 설정, 용량 설정, 오버플로우 모드, 연관된 조회 테이블 이름을 포함하여, 지정된 스태미나 모델 마스터를 가져옵니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>스태미나 모델 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [StaminaModelMaster](#staminamodelmaster) | 스태미나 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetStaminaModelMaster(
    &stamina.GetStaminaModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaModelMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStaminaModelMaster(
        (new GetStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaModelMasterRequest;
import io.gs2.stamina.result.GetStaminaModelMasterResult;

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

try {
    GetStaminaModelMasterResult result = client.getStaminaModelMaster(
        new GetStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    StaminaModelMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaModelMasterResult> asyncResult = null;
yield return client.GetStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.GetStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.getStaminaModelMaster(
        new Gs2Stamina.GetStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_stamina_model_master(
        stamina.GetStaminaModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.get_stamina_model_master({
    namespaceName="namespace-0001",
    staminaName="stamina-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('stamina')

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

```



---

### updateStaminaModelMaster

스태미나 모델 마스터 갱신<br>

지정된 스태미나 모델 마스터의 설명, 메타데이터, 회복 간격, 회복량, 초기 용량, 오버플로우 설정, 최대 용량, 조회 테이블 연관 정보를 갱신합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>스태미나 모델 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| recoverIntervalMinutes | int |  | ✓|  | 0 ~ 2147483646 | 회복 간격(분)<br>스태미나 회복 틱의 간격(분 단위)입니다.<br>이 간격이 경과할 때마다 플레이어의 스태미나가 회복량만큼 증가합니다.<br>RecoverIntervalTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>0으로 설정하면 시간 기반 자동 회복이 비활성화됩니다. |
| recoverValue | int |  | | 1 | 0 ~ 2147483646 | 회복량<br>회복 틱마다 회복되는 스태미나의 양입니다.<br>회복 간격이 경과할 때마다 최대값에 도달할 때까지 이 값만큼 스태미나가 증가합니다.<br>RecoverValueTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다.<br>기본값은 1입니다. |
| initialCapacity | int |  | ✓|  | 0 ~ 2147483646 | 최대값의 초기값<br>모든 플레이어에 대한 기본 스태미나 최대값입니다.<br>오버플로우가 비활성화된 경우, 사용자별 최대값의 하한으로 작용합니다.<br>MaxStaminaTable을 사용하여 GS2-Experience의 랭크별로 사용자 단위로 오버라이드할 수 있습니다. |
| isOverflow | bool |  | ✓|  |  | 오버플로우 가능 여부<br>아이템 사용 등의 수단으로 스태미나가 초기 최대값을 초과할 수 있는지 여부입니다.<br>활성화된 경우, 스태미나는 initialCapacity를 초과하여 maxCapacity까지 설정할 수 있습니다. 자연 회복은 일반적인 최대값에서 정지합니다.<br>비활성화된 경우, 사용자별 최대값은 initialCapacity 이상으로 제한됩니다. |
| maxCapacity | int | {isOverflow} == true | ✓※|  | 0 ~ 2147483646 | 오버플로우 시 최대값<br>오버플로우 활성화 시 스태미나의 절대 상한값입니다.<br>오버플로우 상태에서도 스태미나는 이 값을 초과할 수 없습니다. isOverflow가 true인 경우에만 표시됩니다.<br>※ isOverflow이(가) true 이면 필수 |
| maxStaminaTableName | string |  | |  |  ~ 128자 | 스태미나 최대값 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 스태미나 최대값을 동적으로 결정하는 MaxStaminaTable의 이름입니다.<br>설정 시, 플레이어의 최대 스태미나는 현재 랭크 인덱스로 테이블에서 참조되며, initialCapacity를 오버라이드합니다. |
| recoverIntervalTableName | string |  | |  |  ~ 128자 | 회복 간격 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 회복 간격을 동적으로 결정하는 RecoverIntervalTable의 이름입니다.<br>설정 시, 플레이어의 회복 간격은 테이블에서 참조되며, recoverIntervalMinutes를 오버라이드합니다. |
| recoverValueTableName | string |  | |  |  ~ 128자 | 회복량 테이블 이름<br>플레이어의 GS2-Experience 랭크에 기반하여 회복량을 동적으로 결정하는 RecoverValueTable의 이름입니다.<br>설정 시, 플레이어의 회복량은 테이블에서 참조되며, recoverValue를 오버라이드합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [StaminaModelMaster](#staminamodelmaster) | 갱신한 스태미나 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateStaminaModelMaster(
    &stamina.UpdateStaminaModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("STAMINA_MODEL_MASTER_0001"),
        RecoverIntervalMinutes: pointy.Int32(20),
        RecoverValue: pointy.Int32(2),
        InitialCapacity: pointy.Int32(60),
        IsOverflow: pointy.Bool(true),
        MaxCapacity: pointy.Int32(999),
        MaxStaminaTableName: pointy.String("maxStaminaTable-0002"),
        RecoverIntervalTableName: pointy.String("recoverIntervalTable-0002"),
        RecoverValueTableName: pointy.String("recoverValueTable-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateStaminaModelMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateStaminaModelMaster(
        (new UpdateStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withDescription("description1")
            ->withMetadata("STAMINA_MODEL_MASTER_0001")
            ->withRecoverIntervalMinutes(20)
            ->withRecoverValue(2)
            ->withInitialCapacity(60)
            ->withIsOverflow(true)
            ->withMaxCapacity(999)
            ->withMaxStaminaTableName("maxStaminaTable-0002")
            ->withRecoverIntervalTableName("recoverIntervalTable-0002")
            ->withRecoverValueTableName("recoverValueTable-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateStaminaModelMasterRequest;
import io.gs2.stamina.result.UpdateStaminaModelMasterResult;

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

try {
    UpdateStaminaModelMasterResult result = client.updateStaminaModelMaster(
        new UpdateStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withDescription("description1")
            .withMetadata("STAMINA_MODEL_MASTER_0001")
            .withRecoverIntervalMinutes(20)
            .withRecoverValue(2)
            .withInitialCapacity(60)
            .withIsOverflow(true)
            .withMaxCapacity(999)
            .withMaxStaminaTableName("maxStaminaTable-0002")
            .withRecoverIntervalTableName("recoverIntervalTable-0002")
            .withRecoverValueTableName("recoverValueTable-0002")
    );
    StaminaModelMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateStaminaModelMasterResult> asyncResult = null;
yield return client.UpdateStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.UpdateStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithDescription("description1")
        .WithMetadata("STAMINA_MODEL_MASTER_0001")
        .WithRecoverIntervalMinutes(20)
        .WithRecoverValue(2)
        .WithInitialCapacity(60)
        .WithIsOverflow(true)
        .WithMaxCapacity(999)
        .WithMaxStaminaTableName("maxStaminaTable-0002")
        .WithRecoverIntervalTableName("recoverIntervalTable-0002")
        .WithRecoverValueTableName("recoverValueTable-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.updateStaminaModelMaster(
        new Gs2Stamina.UpdateStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withDescription("description1")
            .withMetadata("STAMINA_MODEL_MASTER_0001")
            .withRecoverIntervalMinutes(20)
            .withRecoverValue(2)
            .withInitialCapacity(60)
            .withIsOverflow(true)
            .withMaxCapacity(999)
            .withMaxStaminaTableName("maxStaminaTable-0002")
            .withRecoverIntervalTableName("recoverIntervalTable-0002")
            .withRecoverValueTableName("recoverValueTable-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.update_stamina_model_master(
        stamina.UpdateStaminaModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_description('description1')
            .with_metadata('STAMINA_MODEL_MASTER_0001')
            .with_recover_interval_minutes(20)
            .with_recover_value(2)
            .with_initial_capacity(60)
            .with_is_overflow(True)
            .with_max_capacity(999)
            .with_max_stamina_table_name('maxStaminaTable-0002')
            .with_recover_interval_table_name('recover_interval_table-0002')
            .with_recover_value_table_name('recoverValueTable-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.update_stamina_model_master({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    description="description1",
    metadata="STAMINA_MODEL_MASTER_0001",
    recoverIntervalMinutes=20,
    recoverValue=2,
    initialCapacity=60,
    isOverflow=true,
    maxCapacity=999,
    maxStaminaTableName="maxStaminaTable-0002",
    recoverIntervalTableName="recoverIntervalTable-0002",
    recoverValueTableName="recoverValueTable-0002",
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('stamina')

api_result_handler = client.update_stamina_model_master_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    description="description1",
    metadata="STAMINA_MODEL_MASTER_0001",
    recoverIntervalMinutes=20,
    recoverValue=2,
    initialCapacity=60,
    isOverflow=true,
    maxCapacity=999,
    maxStaminaTableName="maxStaminaTable-0002",
    recoverIntervalTableName="recoverIntervalTable-0002",
    recoverValueTableName="recoverValueTable-0002",
})

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

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

result = api_result.result
item = result.item;

```



---

### deleteStaminaModelMaster

스태미나 모델 마스터 삭제<br>

지정된 스태미나 모델 마스터를 삭제합니다. 이는 마스터 정의만 삭제하며, 현재 활성화된 스태미나 설정에는 영향을 주지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| staminaName | string |  | ✓|  |  ~ 128자 | 스태미나 모델 이름<br>스태미나 모델 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [StaminaModelMaster](#staminamodelmaster) | 삭제한 스태미나 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DeleteStaminaModelMaster(
    &stamina.DeleteStaminaModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteStaminaModelMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteStaminaModelMaster(
        (new DeleteStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteStaminaModelMasterRequest;
import io.gs2.stamina.result.DeleteStaminaModelMasterResult;

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

try {
    DeleteStaminaModelMasterResult result = client.deleteStaminaModelMaster(
        new DeleteStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    StaminaModelMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteStaminaModelMasterResult> asyncResult = null;
yield return client.DeleteStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.DeleteStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.deleteStaminaModelMaster(
        new Gs2Stamina.DeleteStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.delete_stamina_model_master(
        stamina.DeleteStaminaModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.delete_stamina_model_master({
    namespaceName="namespace-0001",
    staminaName="stamina-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('stamina')

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

```



---

### describeMaxStaminaTableMasters

스태미나 최댓값 테이블 마스터 목록 가져오기<br>

스태미나 최댓값 테이블 마스터의 페이지네이션 리스트를 가져옵니다. 이 테이블들은 경험치 랭크 값을 스태미나 최대 용량에 매핑하여 레벨 기반의 스태미나 스케일링을 가능하게 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;MaxStaminaTableMaster&gt;](#maxstaminatablemaster) | 스태미나 최댓값 테이블 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DescribeMaxStaminaTableMasters(
    &stamina.DescribeMaxStaminaTableMastersRequest {
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeMaxStaminaTableMastersRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeMaxStaminaTableMasters(
        (new DescribeMaxStaminaTableMastersRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeMaxStaminaTableMastersRequest;
import io.gs2.stamina.result.DescribeMaxStaminaTableMastersResult;

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

try {
    DescribeMaxStaminaTableMastersResult result = client.describeMaxStaminaTableMasters(
        new DescribeMaxStaminaTableMastersRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<MaxStaminaTableMaster> 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeMaxStaminaTableMastersResult> asyncResult = null;
yield return client.DescribeMaxStaminaTableMasters(
    new Gs2.Gs2Stamina.Request.DescribeMaxStaminaTableMastersRequest()
        .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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.describeMaxStaminaTableMasters(
        new Gs2Stamina.DescribeMaxStaminaTableMastersRequest()
            .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 stamina

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

try:
    result = client.describe_max_stamina_table_masters(
        stamina.DescribeMaxStaminaTableMastersRequest()
            .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('stamina')

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

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

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

```

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

client = gs2('stamina')

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

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

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

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

```



---

### createMaxStaminaTableMaster

스태미나 최댓값 테이블 마스터 신규 생성<br>

경험치 모델 ID와 값 배열을 가진 새로운 스태미나 최댓값 테이블 마스터를 생성합니다. 값 배열은 경험치 랭크로 인덱싱되며, 각 랭크를 해당하는 스태미나 최대 용량에 매핑합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 최대 스태미나 값 테이블 이름<br>최대 스태미나 값 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓|  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 스태미나 최대값이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓|  | 1 ~ 1024 items | 랭크별 스태미나 최대값<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 스태미나 최대값의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 최대 스태미나로 사용됩니다. 배열 길이는 참조하는 ExperienceModel에서 정의된 랭크 수와 일치해야 합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [MaxStaminaTableMaster](#maxstaminatablemaster) | 생성한 스태미나 최댓값 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateMaxStaminaTableMaster(
    &stamina.CreateMaxStaminaTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("max-stamina-table-0001"),
        Description: nil,
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-0001"),
        Values: []*int32{
            pointy.Int32(50),
            pointy.Int32(150),
            pointy.Int32(250),
            pointy.Int32(350),
            pointy.Int32(450),
            pointy.Int32(550),
            pointy.Int32(650),
            pointy.Int32(750),
            pointy.Int32(850),
            pointy.Int32(950),
            pointy.Int32(1050),
            pointy.Int32(1150),
            pointy.Int32(1250),
            pointy.Int32(1350),
            pointy.Int32(1450),
            pointy.Int32(1550),
            pointy.Int32(1650),
            pointy.Int32(1750),
            pointy.Int32(1850),
            pointy.Int32(1950),
            pointy.Int32(2050),
            pointy.Int32(2150),
            pointy.Int32(2250),
            pointy.Int32(2350),
            pointy.Int32(2450),
            pointy.Int32(2550),
            pointy.Int32(2650),
            pointy.Int32(2750),
            pointy.Int32(2850),
            pointy.Int32(2950),
            pointy.Int32(3050),
            pointy.Int32(3150),
            pointy.Int32(3250),
            pointy.Int32(3350),
            pointy.Int32(3450),
            pointy.Int32(3550),
            pointy.Int32(3650),
            pointy.Int32(3750),
            pointy.Int32(3850),
            pointy.Int32(3950),
            pointy.Int32(4050),
            pointy.Int32(4150),
            pointy.Int32(4250),
            pointy.Int32(4350),
            pointy.Int32(4450),
            pointy.Int32(4550),
            pointy.Int32(4650),
            pointy.Int32(4750),
            pointy.Int32(4850),
            pointy.Int32(4950),
            pointy.Int32(5050),
            pointy.Int32(5150),
            pointy.Int32(5250),
            pointy.Int32(5350),
            pointy.Int32(5450),
            pointy.Int32(5550),
            pointy.Int32(5650),
            pointy.Int32(5750),
            pointy.Int32(5850),
            pointy.Int32(5950),
            pointy.Int32(6050),
            pointy.Int32(6150),
            pointy.Int32(6250),
            pointy.Int32(6350),
            pointy.Int32(6450),
            pointy.Int32(6550),
            pointy.Int32(6650),
            pointy.Int32(6750),
            pointy.Int32(6850),
            pointy.Int32(6950),
            pointy.Int32(7050),
            pointy.Int32(7150),
            pointy.Int32(7250),
            pointy.Int32(7350),
            pointy.Int32(7450),
            pointy.Int32(7550),
            pointy.Int32(7650),
            pointy.Int32(7750),
            pointy.Int32(7850),
            pointy.Int32(7950),
            pointy.Int32(8050),
            pointy.Int32(8150),
            pointy.Int32(8250),
            pointy.Int32(8350),
            pointy.Int32(8450),
            pointy.Int32(8550),
            pointy.Int32(8650),
            pointy.Int32(8750),
            pointy.Int32(8850),
            pointy.Int32(8950),
            pointy.Int32(9050),
            pointy.Int32(9150),
            pointy.Int32(9250),
            pointy.Int32(9350),
            pointy.Int32(9450),
            pointy.Int32(9550),
            pointy.Int32(9650),
            pointy.Int32(9750),
            pointy.Int32(9850),
            pointy.Int32(9950),
        },
    }
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateMaxStaminaTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createMaxStaminaTableMaster(
        (new CreateMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("max-stamina-table-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-0001")
            ->withValues([
                50,
                150,
                250,
                350,
                450,
                550,
                650,
                750,
                850,
                950,
                1050,
                1150,
                1250,
                1350,
                1450,
                1550,
                1650,
                1750,
                1850,
                1950,
                2050,
                2150,
                2250,
                2350,
                2450,
                2550,
                2650,
                2750,
                2850,
                2950,
                3050,
                3150,
                3250,
                3350,
                3450,
                3550,
                3650,
                3750,
                3850,
                3950,
                4050,
                4150,
                4250,
                4350,
                4450,
                4550,
                4650,
                4750,
                4850,
                4950,
                5050,
                5150,
                5250,
                5350,
                5450,
                5550,
                5650,
                5750,
                5850,
                5950,
                6050,
                6150,
                6250,
                6350,
                6450,
                6550,
                6650,
                6750,
                6850,
                6950,
                7050,
                7150,
                7250,
                7350,
                7450,
                7550,
                7650,
                7750,
                7850,
                7950,
                8050,
                8150,
                8250,
                8350,
                8450,
                8550,
                8650,
                8750,
                8850,
                8950,
                9050,
                9150,
                9250,
                9350,
                9450,
                9550,
                9650,
                9750,
                9850,
                9950,
            ])
    );
    $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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.CreateMaxStaminaTableMasterResult;

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

try {
    CreateMaxStaminaTableMasterResult result = client.createMaxStaminaTableMaster(
        new CreateMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("max-stamina-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues(Arrays.asList(
                50,
                150,
                250,
                350,
                450,
                550,
                650,
                750,
                850,
                950,
                1050,
                1150,
                1250,
                1350,
                1450,
                1550,
                1650,
                1750,
                1850,
                1950,
                2050,
                2150,
                2250,
                2350,
                2450,
                2550,
                2650,
                2750,
                2850,
                2950,
                3050,
                3150,
                3250,
                3350,
                3450,
                3550,
                3650,
                3750,
                3850,
                3950,
                4050,
                4150,
                4250,
                4350,
                4450,
                4550,
                4650,
                4750,
                4850,
                4950,
                5050,
                5150,
                5250,
                5350,
                5450,
                5550,
                5650,
                5750,
                5850,
                5950,
                6050,
                6150,
                6250,
                6350,
                6450,
                6550,
                6650,
                6750,
                6850,
                6950,
                7050,
                7150,
                7250,
                7350,
                7450,
                7550,
                7650,
                7750,
                7850,
                7950,
                8050,
                8150,
                8250,
                8350,
                8450,
                8550,
                8650,
                8750,
                8850,
                8950,
                9050,
                9150,
                9250,
                9350,
                9450,
                9550,
                9650,
                9750,
                9850,
                9950
            ))
    );
    MaxStaminaTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateMaxStaminaTableMasterResult> asyncResult = null;
yield return client.CreateMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.CreateMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("max-stamina-table-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-0001")
        .WithValues(new int[] {
            50,
            150,
            250,
            350,
            450,
            550,
            650,
            750,
            850,
            950,
            1050,
            1150,
            1250,
            1350,
            1450,
            1550,
            1650,
            1750,
            1850,
            1950,
            2050,
            2150,
            2250,
            2350,
            2450,
            2550,
            2650,
            2750,
            2850,
            2950,
            3050,
            3150,
            3250,
            3350,
            3450,
            3550,
            3650,
            3750,
            3850,
            3950,
            4050,
            4150,
            4250,
            4350,
            4450,
            4550,
            4650,
            4750,
            4850,
            4950,
            5050,
            5150,
            5250,
            5350,
            5450,
            5550,
            5650,
            5750,
            5850,
            5950,
            6050,
            6150,
            6250,
            6350,
            6450,
            6550,
            6650,
            6750,
            6850,
            6950,
            7050,
            7150,
            7250,
            7350,
            7450,
            7550,
            7650,
            7750,
            7850,
            7950,
            8050,
            8150,
            8250,
            8350,
            8450,
            8550,
            8650,
            8750,
            8850,
            8950,
            9050,
            9150,
            9250,
            9350,
            9450,
            9550,
            9650,
            9750,
            9850,
            9950,
        }),
    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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.createMaxStaminaTableMaster(
        new Gs2Stamina.CreateMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("max-stamina-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues([
                50,
                150,
                250,
                350,
                450,
                550,
                650,
                750,
                850,
                950,
                1050,
                1150,
                1250,
                1350,
                1450,
                1550,
                1650,
                1750,
                1850,
                1950,
                2050,
                2150,
                2250,
                2350,
                2450,
                2550,
                2650,
                2750,
                2850,
                2950,
                3050,
                3150,
                3250,
                3350,
                3450,
                3550,
                3650,
                3750,
                3850,
                3950,
                4050,
                4150,
                4250,
                4350,
                4450,
                4550,
                4650,
                4750,
                4850,
                4950,
                5050,
                5150,
                5250,
                5350,
                5450,
                5550,
                5650,
                5750,
                5850,
                5950,
                6050,
                6150,
                6250,
                6350,
                6450,
                6550,
                6650,
                6750,
                6850,
                6950,
                7050,
                7150,
                7250,
                7350,
                7450,
                7550,
                7650,
                7750,
                7850,
                7950,
                8050,
                8150,
                8250,
                8350,
                8450,
                8550,
                8650,
                8750,
                8850,
                8950,
                9050,
                9150,
                9250,
                9350,
                9450,
                9550,
                9650,
                9750,
                9850,
                9950,
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.create_max_stamina_table_master(
        stamina.CreateMaxStaminaTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('max-stamina-table-0001')
            .with_description(None)
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-0001')
            .with_values([
                50,
                150,
                250,
                350,
                450,
                550,
                650,
                750,
                850,
                950,
                1050,
                1150,
                1250,
                1350,
                1450,
                1550,
                1650,
                1750,
                1850,
                1950,
                2050,
                2150,
                2250,
                2350,
                2450,
                2550,
                2650,
                2750,
                2850,
                2950,
                3050,
                3150,
                3250,
                3350,
                3450,
                3550,
                3650,
                3750,
                3850,
                3950,
                4050,
                4150,
                4250,
                4350,
                4450,
                4550,
                4650,
                4750,
                4850,
                4950,
                5050,
                5150,
                5250,
                5350,
                5450,
                5550,
                5650,
                5750,
                5850,
                5950,
                6050,
                6150,
                6250,
                6350,
                6450,
                6550,
                6650,
                6750,
                6850,
                6950,
                7050,
                7150,
                7250,
                7350,
                7450,
                7550,
                7650,
                7750,
                7850,
                7950,
                8050,
                8150,
                8250,
                8350,
                8450,
                8550,
                8650,
                8750,
                8850,
                8950,
                9050,
                9150,
                9250,
                9350,
                9450,
                9550,
                9650,
                9750,
                9850,
                9950,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.create_max_stamina_table_master({
    namespaceName="namespace-0001",
    name="max-stamina-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        50,
        150,
        250,
        350,
        450,
        550,
        650,
        750,
        850,
        950,
        1050,
        1150,
        1250,
        1350,
        1450,
        1550,
        1650,
        1750,
        1850,
        1950,
        2050,
        2150,
        2250,
        2350,
        2450,
        2550,
        2650,
        2750,
        2850,
        2950,
        3050,
        3150,
        3250,
        3350,
        3450,
        3550,
        3650,
        3750,
        3850,
        3950,
        4050,
        4150,
        4250,
        4350,
        4450,
        4550,
        4650,
        4750,
        4850,
        4950,
        5050,
        5150,
        5250,
        5350,
        5450,
        5550,
        5650,
        5750,
        5850,
        5950,
        6050,
        6150,
        6250,
        6350,
        6450,
        6550,
        6650,
        6750,
        6850,
        6950,
        7050,
        7150,
        7250,
        7350,
        7450,
        7550,
        7650,
        7750,
        7850,
        7950,
        8050,
        8150,
        8250,
        8350,
        8450,
        8550,
        8650,
        8750,
        8850,
        8950,
        9050,
        9150,
        9250,
        9350,
        9450,
        9550,
        9650,
        9750,
        9850,
        9950
    },
})

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

api_result_handler = client.create_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    name="max-stamina-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        50,
        150,
        250,
        350,
        450,
        550,
        650,
        750,
        850,
        950,
        1050,
        1150,
        1250,
        1350,
        1450,
        1550,
        1650,
        1750,
        1850,
        1950,
        2050,
        2150,
        2250,
        2350,
        2450,
        2550,
        2650,
        2750,
        2850,
        2950,
        3050,
        3150,
        3250,
        3350,
        3450,
        3550,
        3650,
        3750,
        3850,
        3950,
        4050,
        4150,
        4250,
        4350,
        4450,
        4550,
        4650,
        4750,
        4850,
        4950,
        5050,
        5150,
        5250,
        5350,
        5450,
        5550,
        5650,
        5750,
        5850,
        5950,
        6050,
        6150,
        6250,
        6350,
        6450,
        6550,
        6650,
        6750,
        6850,
        6950,
        7050,
        7150,
        7250,
        7350,
        7450,
        7550,
        7650,
        7750,
        7850,
        7950,
        8050,
        8150,
        8250,
        8350,
        8450,
        8550,
        8650,
        8750,
        8850,
        8950,
        9050,
        9150,
        9250,
        9350,
        9450,
        9550,
        9650,
        9750,
        9850,
        9950
    },
})

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

```



---

### getMaxStaminaTableMaster

스태미나 최댓값 테이블 마스터 가져오기<br>

경험치 모델 연관 정보와 랭크에서 용량으로의 값 매핑을 포함하여, 지정된 스태미나 최댓값 테이블 마스터를 가져옵니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| maxStaminaTableName | string |  | ✓|  |  ~ 128자 | 최대 스태미나 값 테이블 이름<br>최대 스태미나 값 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [MaxStaminaTableMaster](#maxstaminatablemaster) | 스태미나 최댓값 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetMaxStaminaTableMaster(
    &stamina.GetMaxStaminaTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MaxStaminaTableName: pointy.String("max-stamina-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetMaxStaminaTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getMaxStaminaTableMaster(
        (new GetMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMaxStaminaTableName("max-stamina-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.GetMaxStaminaTableMasterResult;

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

try {
    GetMaxStaminaTableMasterResult result = client.getMaxStaminaTableMaster(
        new GetMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
    );
    MaxStaminaTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetMaxStaminaTableMasterResult> asyncResult = null;
yield return client.GetMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.GetMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMaxStaminaTableName("max-stamina-table-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.getMaxStaminaTableMaster(
        new Gs2Stamina.GetMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_max_stamina_table_master(
        stamina.GetMaxStaminaTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_max_stamina_table_name('max-stamina-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.get_max_stamina_table_master({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-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('stamina')

api_result_handler = client.get_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-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;

```



---

### updateMaxStaminaTableMaster

스태미나 최댓값 테이블 마스터 갱신<br>

지정된 스태미나 최댓값 테이블 마스터의 설명, 메타데이터, 경험치 모델 연관 정보, 랭크에서 용량으로의 값 매핑을 갱신합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| maxStaminaTableName | string |  | ✓|  |  ~ 128자 | 최대 스태미나 값 테이블 이름<br>최대 스태미나 값 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓|  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 스태미나 최대값이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓|  | 1 ~ 1024 items | 랭크별 스태미나 최대값<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 스태미나 최대값의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 최대 스태미나로 사용됩니다. 배열 길이는 참조하는 ExperienceModel에서 정의된 랭크 수와 일치해야 합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [MaxStaminaTableMaster](#maxstaminatablemaster) | 갱신한 스태미나 최댓값 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateMaxStaminaTableMaster(
    &stamina.UpdateMaxStaminaTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MaxStaminaTableName: pointy.String("max-stamina-table-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-1001"),
        Values: []*int32{
            pointy.Int32(50),
            pointy.Int32(200),
            pointy.Int32(350),
            pointy.Int32(500),
            pointy.Int32(650),
            pointy.Int32(800),
            pointy.Int32(950),
            pointy.Int32(1100),
            pointy.Int32(1250),
            pointy.Int32(1400),
            pointy.Int32(1550),
            pointy.Int32(1700),
            pointy.Int32(1850),
            pointy.Int32(2000),
            pointy.Int32(2150),
            pointy.Int32(2300),
            pointy.Int32(2450),
            pointy.Int32(2600),
            pointy.Int32(2750),
            pointy.Int32(2900),
            pointy.Int32(3050),
            pointy.Int32(3200),
            pointy.Int32(3350),
            pointy.Int32(3500),
            pointy.Int32(3650),
            pointy.Int32(3800),
            pointy.Int32(3950),
            pointy.Int32(4100),
            pointy.Int32(4250),
            pointy.Int32(4400),
            pointy.Int32(4550),
            pointy.Int32(4700),
            pointy.Int32(4850),
            pointy.Int32(5000),
            pointy.Int32(5150),
            pointy.Int32(5300),
            pointy.Int32(5450),
            pointy.Int32(5600),
            pointy.Int32(5750),
            pointy.Int32(5900),
            pointy.Int32(6050),
            pointy.Int32(6200),
            pointy.Int32(6350),
            pointy.Int32(6500),
            pointy.Int32(6650),
            pointy.Int32(6800),
            pointy.Int32(6950),
            pointy.Int32(7100),
            pointy.Int32(7250),
            pointy.Int32(7400),
            pointy.Int32(7550),
            pointy.Int32(7700),
            pointy.Int32(7850),
            pointy.Int32(8000),
            pointy.Int32(8150),
            pointy.Int32(8300),
            pointy.Int32(8450),
            pointy.Int32(8600),
            pointy.Int32(8750),
            pointy.Int32(8900),
            pointy.Int32(9050),
            pointy.Int32(9200),
            pointy.Int32(9350),
            pointy.Int32(9500),
            pointy.Int32(9650),
            pointy.Int32(9800),
            pointy.Int32(9950),
            pointy.Int32(10100),
            pointy.Int32(10250),
            pointy.Int32(10400),
            pointy.Int32(10550),
            pointy.Int32(10700),
            pointy.Int32(10850),
            pointy.Int32(11000),
            pointy.Int32(11150),
            pointy.Int32(11300),
            pointy.Int32(11450),
            pointy.Int32(11600),
            pointy.Int32(11750),
            pointy.Int32(11900),
            pointy.Int32(12050),
            pointy.Int32(12200),
            pointy.Int32(12350),
            pointy.Int32(12500),
            pointy.Int32(12650),
            pointy.Int32(12800),
            pointy.Int32(12950),
            pointy.Int32(13100),
            pointy.Int32(13250),
            pointy.Int32(13400),
            pointy.Int32(13550),
            pointy.Int32(13700),
            pointy.Int32(13850),
            pointy.Int32(14000),
            pointy.Int32(14150),
            pointy.Int32(14300),
            pointy.Int32(14450),
            pointy.Int32(14600),
            pointy.Int32(14750),
            pointy.Int32(14900),
        },
    }
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateMaxStaminaTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateMaxStaminaTableMaster(
        (new UpdateMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMaxStaminaTableName("max-stamina-table-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-1001")
            ->withValues([
                50,
                200,
                350,
                500,
                650,
                800,
                950,
                1100,
                1250,
                1400,
                1550,
                1700,
                1850,
                2000,
                2150,
                2300,
                2450,
                2600,
                2750,
                2900,
                3050,
                3200,
                3350,
                3500,
                3650,
                3800,
                3950,
                4100,
                4250,
                4400,
                4550,
                4700,
                4850,
                5000,
                5150,
                5300,
                5450,
                5600,
                5750,
                5900,
                6050,
                6200,
                6350,
                6500,
                6650,
                6800,
                6950,
                7100,
                7250,
                7400,
                7550,
                7700,
                7850,
                8000,
                8150,
                8300,
                8450,
                8600,
                8750,
                8900,
                9050,
                9200,
                9350,
                9500,
                9650,
                9800,
                9950,
                10100,
                10250,
                10400,
                10550,
                10700,
                10850,
                11000,
                11150,
                11300,
                11450,
                11600,
                11750,
                11900,
                12050,
                12200,
                12350,
                12500,
                12650,
                12800,
                12950,
                13100,
                13250,
                13400,
                13550,
                13700,
                13850,
                14000,
                14150,
                14300,
                14450,
                14600,
                14750,
                14900,
            ])
    );
    $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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.UpdateMaxStaminaTableMasterResult;

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

try {
    UpdateMaxStaminaTableMasterResult result = client.updateMaxStaminaTableMaster(
        new UpdateMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues(Arrays.asList(
                50,
                200,
                350,
                500,
                650,
                800,
                950,
                1100,
                1250,
                1400,
                1550,
                1700,
                1850,
                2000,
                2150,
                2300,
                2450,
                2600,
                2750,
                2900,
                3050,
                3200,
                3350,
                3500,
                3650,
                3800,
                3950,
                4100,
                4250,
                4400,
                4550,
                4700,
                4850,
                5000,
                5150,
                5300,
                5450,
                5600,
                5750,
                5900,
                6050,
                6200,
                6350,
                6500,
                6650,
                6800,
                6950,
                7100,
                7250,
                7400,
                7550,
                7700,
                7850,
                8000,
                8150,
                8300,
                8450,
                8600,
                8750,
                8900,
                9050,
                9200,
                9350,
                9500,
                9650,
                9800,
                9950,
                10100,
                10250,
                10400,
                10550,
                10700,
                10850,
                11000,
                11150,
                11300,
                11450,
                11600,
                11750,
                11900,
                12050,
                12200,
                12350,
                12500,
                12650,
                12800,
                12950,
                13100,
                13250,
                13400,
                13550,
                13700,
                13850,
                14000,
                14150,
                14300,
                14450,
                14600,
                14750,
                14900
            ))
    );
    MaxStaminaTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateMaxStaminaTableMasterResult> asyncResult = null;
yield return client.UpdateMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.UpdateMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMaxStaminaTableName("max-stamina-table-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-1001")
        .WithValues(new int[] {
            50,
            200,
            350,
            500,
            650,
            800,
            950,
            1100,
            1250,
            1400,
            1550,
            1700,
            1850,
            2000,
            2150,
            2300,
            2450,
            2600,
            2750,
            2900,
            3050,
            3200,
            3350,
            3500,
            3650,
            3800,
            3950,
            4100,
            4250,
            4400,
            4550,
            4700,
            4850,
            5000,
            5150,
            5300,
            5450,
            5600,
            5750,
            5900,
            6050,
            6200,
            6350,
            6500,
            6650,
            6800,
            6950,
            7100,
            7250,
            7400,
            7550,
            7700,
            7850,
            8000,
            8150,
            8300,
            8450,
            8600,
            8750,
            8900,
            9050,
            9200,
            9350,
            9500,
            9650,
            9800,
            9950,
            10100,
            10250,
            10400,
            10550,
            10700,
            10850,
            11000,
            11150,
            11300,
            11450,
            11600,
            11750,
            11900,
            12050,
            12200,
            12350,
            12500,
            12650,
            12800,
            12950,
            13100,
            13250,
            13400,
            13550,
            13700,
            13850,
            14000,
            14150,
            14300,
            14450,
            14600,
            14750,
            14900,
        }),
    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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.updateMaxStaminaTableMaster(
        new Gs2Stamina.UpdateMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues([
                50,
                200,
                350,
                500,
                650,
                800,
                950,
                1100,
                1250,
                1400,
                1550,
                1700,
                1850,
                2000,
                2150,
                2300,
                2450,
                2600,
                2750,
                2900,
                3050,
                3200,
                3350,
                3500,
                3650,
                3800,
                3950,
                4100,
                4250,
                4400,
                4550,
                4700,
                4850,
                5000,
                5150,
                5300,
                5450,
                5600,
                5750,
                5900,
                6050,
                6200,
                6350,
                6500,
                6650,
                6800,
                6950,
                7100,
                7250,
                7400,
                7550,
                7700,
                7850,
                8000,
                8150,
                8300,
                8450,
                8600,
                8750,
                8900,
                9050,
                9200,
                9350,
                9500,
                9650,
                9800,
                9950,
                10100,
                10250,
                10400,
                10550,
                10700,
                10850,
                11000,
                11150,
                11300,
                11450,
                11600,
                11750,
                11900,
                12050,
                12200,
                12350,
                12500,
                12650,
                12800,
                12950,
                13100,
                13250,
                13400,
                13550,
                13700,
                13850,
                14000,
                14150,
                14300,
                14450,
                14600,
                14750,
                14900,
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.update_max_stamina_table_master(
        stamina.UpdateMaxStaminaTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_max_stamina_table_name('max-stamina-table-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-1001')
            .with_values([
                50,
                200,
                350,
                500,
                650,
                800,
                950,
                1100,
                1250,
                1400,
                1550,
                1700,
                1850,
                2000,
                2150,
                2300,
                2450,
                2600,
                2750,
                2900,
                3050,
                3200,
                3350,
                3500,
                3650,
                3800,
                3950,
                4100,
                4250,
                4400,
                4550,
                4700,
                4850,
                5000,
                5150,
                5300,
                5450,
                5600,
                5750,
                5900,
                6050,
                6200,
                6350,
                6500,
                6650,
                6800,
                6950,
                7100,
                7250,
                7400,
                7550,
                7700,
                7850,
                8000,
                8150,
                8300,
                8450,
                8600,
                8750,
                8900,
                9050,
                9200,
                9350,
                9500,
                9650,
                9800,
                9950,
                10100,
                10250,
                10400,
                10550,
                10700,
                10850,
                11000,
                11150,
                11300,
                11450,
                11600,
                11750,
                11900,
                12050,
                12200,
                12350,
                12500,
                12650,
                12800,
                12950,
                13100,
                13250,
                13400,
                13550,
                13700,
                13850,
                14000,
                14150,
                14300,
                14450,
                14600,
                14750,
                14900,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.update_max_stamina_table_master({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        50,
        200,
        350,
        500,
        650,
        800,
        950,
        1100,
        1250,
        1400,
        1550,
        1700,
        1850,
        2000,
        2150,
        2300,
        2450,
        2600,
        2750,
        2900,
        3050,
        3200,
        3350,
        3500,
        3650,
        3800,
        3950,
        4100,
        4250,
        4400,
        4550,
        4700,
        4850,
        5000,
        5150,
        5300,
        5450,
        5600,
        5750,
        5900,
        6050,
        6200,
        6350,
        6500,
        6650,
        6800,
        6950,
        7100,
        7250,
        7400,
        7550,
        7700,
        7850,
        8000,
        8150,
        8300,
        8450,
        8600,
        8750,
        8900,
        9050,
        9200,
        9350,
        9500,
        9650,
        9800,
        9950,
        10100,
        10250,
        10400,
        10550,
        10700,
        10850,
        11000,
        11150,
        11300,
        11450,
        11600,
        11750,
        11900,
        12050,
        12200,
        12350,
        12500,
        12650,
        12800,
        12950,
        13100,
        13250,
        13400,
        13550,
        13700,
        13850,
        14000,
        14150,
        14300,
        14450,
        14600,
        14750,
        14900
    },
})

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

api_result_handler = client.update_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        50,
        200,
        350,
        500,
        650,
        800,
        950,
        1100,
        1250,
        1400,
        1550,
        1700,
        1850,
        2000,
        2150,
        2300,
        2450,
        2600,
        2750,
        2900,
        3050,
        3200,
        3350,
        3500,
        3650,
        3800,
        3950,
        4100,
        4250,
        4400,
        4550,
        4700,
        4850,
        5000,
        5150,
        5300,
        5450,
        5600,
        5750,
        5900,
        6050,
        6200,
        6350,
        6500,
        6650,
        6800,
        6950,
        7100,
        7250,
        7400,
        7550,
        7700,
        7850,
        8000,
        8150,
        8300,
        8450,
        8600,
        8750,
        8900,
        9050,
        9200,
        9350,
        9500,
        9650,
        9800,
        9950,
        10100,
        10250,
        10400,
        10550,
        10700,
        10850,
        11000,
        11150,
        11300,
        11450,
        11600,
        11750,
        11900,
        12050,
        12200,
        12350,
        12500,
        12650,
        12800,
        12950,
        13100,
        13250,
        13400,
        13550,
        13700,
        13850,
        14000,
        14150,
        14300,
        14450,
        14600,
        14750,
        14900
    },
})

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

```



---

### deleteMaxStaminaTableMaster

스태미나 최댓값 테이블 마스터 삭제<br>

지정된 스태미나 최댓값 테이블 마스터를 삭제합니다. 이는 마스터 정의만 삭제하며, 현재 활성화된 스태미나 설정에는 영향을 주지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| maxStaminaTableName | string |  | ✓|  |  ~ 128자 | 최대 스태미나 값 테이블 이름<br>최대 스태미나 값 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [MaxStaminaTableMaster](#maxstaminatablemaster) | 삭제한 스태미나 최댓값 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DeleteMaxStaminaTableMaster(
    &stamina.DeleteMaxStaminaTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MaxStaminaTableName: pointy.String("max-stamina-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteMaxStaminaTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteMaxStaminaTableMaster(
        (new DeleteMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMaxStaminaTableName("max-stamina-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.DeleteMaxStaminaTableMasterResult;

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

try {
    DeleteMaxStaminaTableMasterResult result = client.deleteMaxStaminaTableMaster(
        new DeleteMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
    );
    MaxStaminaTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteMaxStaminaTableMasterResult> asyncResult = null;
yield return client.DeleteMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.DeleteMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMaxStaminaTableName("max-stamina-table-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.deleteMaxStaminaTableMaster(
        new Gs2Stamina.DeleteMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.delete_max_stamina_table_master(
        stamina.DeleteMaxStaminaTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_max_stamina_table_name('max-stamina-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.delete_max_stamina_table_master({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-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('stamina')

api_result_handler = client.delete_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-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;

```



---

### describeRecoverIntervalTableMasters

회복 간격 테이블 마스터 목록 취득<br>

회복 간격 테이블 마스터의 페이지네이션된 목록을 취득합니다. 이름의 접두사로 필터링할 수 있습니다. 이 테이블은 경험치 랭크 값을 스태미나 회복 간격(분)에 매핑하여, 레벨 기반의 회복 속도 스케일링을 가능하게 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 회복 간격 테이블 이름의 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;RecoverIntervalTableMaster&gt;](#recoverintervaltablemaster) | 회복 간격 테이블 마스터의 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DescribeRecoverIntervalTableMasters(
    &stamina.DescribeRecoverIntervalTableMastersRequest {
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeRecoverIntervalTableMastersRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeRecoverIntervalTableMasters(
        (new DescribeRecoverIntervalTableMastersRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeRecoverIntervalTableMastersRequest;
import io.gs2.stamina.result.DescribeRecoverIntervalTableMastersResult;

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

try {
    DescribeRecoverIntervalTableMastersResult result = client.describeRecoverIntervalTableMasters(
        new DescribeRecoverIntervalTableMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RecoverIntervalTableMaster> 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeRecoverIntervalTableMastersResult> asyncResult = null;
yield return client.DescribeRecoverIntervalTableMasters(
    new Gs2.Gs2Stamina.Request.DescribeRecoverIntervalTableMastersRequest()
        .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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.describeRecoverIntervalTableMasters(
        new Gs2Stamina.DescribeRecoverIntervalTableMastersRequest()
            .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 stamina

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

try:
    result = client.describe_recover_interval_table_masters(
        stamina.DescribeRecoverIntervalTableMastersRequest()
            .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('stamina')

api_result = client.describe_recover_interval_table_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('stamina')

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

```



---

### createRecoverIntervalTableMaster

회복 간격 테이블 마스터를 신규 작성<br>

경험치 모델 ID와 값 배열을 가진 새로운 회복 간격 테이블 마스터를 작성합니다. 값 배열은 경험치 랭크로 인덱싱되며, 각 랭크를 대응하는 회복 간격(분)에 매핑합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 회복 간격 테이블 이름<br>회복 간격 테이블 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓|  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복 간격이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓|  | 1 ~ 1024 items | 랭크별 회복 간격(분)<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복 간격 값(분 단위)의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 회복 간격으로 사용되며, 모델의 기본값 recoverIntervalMinutes를 오버라이드합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverIntervalTableMaster](#recoverintervaltablemaster) | 작성한 회복 간격 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateRecoverIntervalTableMaster(
    &stamina.CreateRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("recover-interval-table-0001"),
        Description: nil,
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-0001"),
        Values: []*int32{
            pointy.Int32(40),
            pointy.Int32(140),
            pointy.Int32(240),
            pointy.Int32(340),
            pointy.Int32(440),
            pointy.Int32(540),
            pointy.Int32(640),
            pointy.Int32(740),
            pointy.Int32(840),
            pointy.Int32(940),
            pointy.Int32(1040),
            pointy.Int32(1140),
            pointy.Int32(1240),
            pointy.Int32(1340),
            pointy.Int32(1440),
            pointy.Int32(1540),
            pointy.Int32(1640),
            pointy.Int32(1740),
            pointy.Int32(1840),
            pointy.Int32(1940),
            pointy.Int32(2040),
            pointy.Int32(2140),
            pointy.Int32(2240),
            pointy.Int32(2340),
            pointy.Int32(2440),
            pointy.Int32(2540),
            pointy.Int32(2640),
            pointy.Int32(2740),
            pointy.Int32(2840),
            pointy.Int32(2940),
            pointy.Int32(3040),
            pointy.Int32(3140),
            pointy.Int32(3240),
            pointy.Int32(3340),
            pointy.Int32(3440),
            pointy.Int32(3540),
            pointy.Int32(3640),
            pointy.Int32(3740),
            pointy.Int32(3840),
            pointy.Int32(3940),
            pointy.Int32(4040),
            pointy.Int32(4140),
            pointy.Int32(4240),
            pointy.Int32(4340),
            pointy.Int32(4440),
            pointy.Int32(4540),
            pointy.Int32(4640),
            pointy.Int32(4740),
            pointy.Int32(4840),
            pointy.Int32(4940),
            pointy.Int32(5040),
            pointy.Int32(5140),
            pointy.Int32(5240),
            pointy.Int32(5340),
            pointy.Int32(5440),
            pointy.Int32(5540),
            pointy.Int32(5640),
            pointy.Int32(5740),
            pointy.Int32(5840),
            pointy.Int32(5940),
            pointy.Int32(6040),
            pointy.Int32(6140),
            pointy.Int32(6240),
            pointy.Int32(6340),
            pointy.Int32(6440),
            pointy.Int32(6540),
            pointy.Int32(6640),
            pointy.Int32(6740),
            pointy.Int32(6840),
            pointy.Int32(6940),
            pointy.Int32(7040),
            pointy.Int32(7140),
            pointy.Int32(7240),
            pointy.Int32(7340),
            pointy.Int32(7440),
            pointy.Int32(7540),
            pointy.Int32(7640),
            pointy.Int32(7740),
            pointy.Int32(7840),
            pointy.Int32(7940),
            pointy.Int32(8040),
            pointy.Int32(8140),
            pointy.Int32(8240),
            pointy.Int32(8340),
            pointy.Int32(8440),
            pointy.Int32(8540),
            pointy.Int32(8640),
            pointy.Int32(8740),
            pointy.Int32(8840),
            pointy.Int32(8940),
            pointy.Int32(9040),
            pointy.Int32(9140),
            pointy.Int32(9240),
            pointy.Int32(9340),
            pointy.Int32(9440),
            pointy.Int32(9540),
            pointy.Int32(9640),
            pointy.Int32(9740),
            pointy.Int32(9840),
            pointy.Int32(9940),
        },
    }
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateRecoverIntervalTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createRecoverIntervalTableMaster(
        (new CreateRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("recover-interval-table-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-0001")
            ->withValues([
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940,
            ])
    );
    $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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.CreateRecoverIntervalTableMasterResult;

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

try {
    CreateRecoverIntervalTableMasterResult result = client.createRecoverIntervalTableMaster(
        new CreateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-interval-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues(Arrays.asList(
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940
            ))
    );
    RecoverIntervalTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.CreateRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.CreateRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("recover-interval-table-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-0001")
        .WithValues(new int[] {
            40,
            140,
            240,
            340,
            440,
            540,
            640,
            740,
            840,
            940,
            1040,
            1140,
            1240,
            1340,
            1440,
            1540,
            1640,
            1740,
            1840,
            1940,
            2040,
            2140,
            2240,
            2340,
            2440,
            2540,
            2640,
            2740,
            2840,
            2940,
            3040,
            3140,
            3240,
            3340,
            3440,
            3540,
            3640,
            3740,
            3840,
            3940,
            4040,
            4140,
            4240,
            4340,
            4440,
            4540,
            4640,
            4740,
            4840,
            4940,
            5040,
            5140,
            5240,
            5340,
            5440,
            5540,
            5640,
            5740,
            5840,
            5940,
            6040,
            6140,
            6240,
            6340,
            6440,
            6540,
            6640,
            6740,
            6840,
            6940,
            7040,
            7140,
            7240,
            7340,
            7440,
            7540,
            7640,
            7740,
            7840,
            7940,
            8040,
            8140,
            8240,
            8340,
            8440,
            8540,
            8640,
            8740,
            8840,
            8940,
            9040,
            9140,
            9240,
            9340,
            9440,
            9540,
            9640,
            9740,
            9840,
            9940,
        }),
    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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.createRecoverIntervalTableMaster(
        new Gs2Stamina.CreateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-interval-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues([
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940,
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.create_recover_interval_table_master(
        stamina.CreateRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('recover-interval-table-0001')
            .with_description(None)
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-0001')
            .with_values([
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.create_recover_interval_table_master({
    namespaceName="namespace-0001",
    name="recover-interval-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        40,
        140,
        240,
        340,
        440,
        540,
        640,
        740,
        840,
        940,
        1040,
        1140,
        1240,
        1340,
        1440,
        1540,
        1640,
        1740,
        1840,
        1940,
        2040,
        2140,
        2240,
        2340,
        2440,
        2540,
        2640,
        2740,
        2840,
        2940,
        3040,
        3140,
        3240,
        3340,
        3440,
        3540,
        3640,
        3740,
        3840,
        3940,
        4040,
        4140,
        4240,
        4340,
        4440,
        4540,
        4640,
        4740,
        4840,
        4940,
        5040,
        5140,
        5240,
        5340,
        5440,
        5540,
        5640,
        5740,
        5840,
        5940,
        6040,
        6140,
        6240,
        6340,
        6440,
        6540,
        6640,
        6740,
        6840,
        6940,
        7040,
        7140,
        7240,
        7340,
        7440,
        7540,
        7640,
        7740,
        7840,
        7940,
        8040,
        8140,
        8240,
        8340,
        8440,
        8540,
        8640,
        8740,
        8840,
        8940,
        9040,
        9140,
        9240,
        9340,
        9440,
        9540,
        9640,
        9740,
        9840,
        9940
    },
})

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

api_result_handler = client.create_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    name="recover-interval-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        40,
        140,
        240,
        340,
        440,
        540,
        640,
        740,
        840,
        940,
        1040,
        1140,
        1240,
        1340,
        1440,
        1540,
        1640,
        1740,
        1840,
        1940,
        2040,
        2140,
        2240,
        2340,
        2440,
        2540,
        2640,
        2740,
        2840,
        2940,
        3040,
        3140,
        3240,
        3340,
        3440,
        3540,
        3640,
        3740,
        3840,
        3940,
        4040,
        4140,
        4240,
        4340,
        4440,
        4540,
        4640,
        4740,
        4840,
        4940,
        5040,
        5140,
        5240,
        5340,
        5440,
        5540,
        5640,
        5740,
        5840,
        5940,
        6040,
        6140,
        6240,
        6340,
        6440,
        6540,
        6640,
        6740,
        6840,
        6940,
        7040,
        7140,
        7240,
        7340,
        7440,
        7540,
        7640,
        7740,
        7840,
        7940,
        8040,
        8140,
        8240,
        8340,
        8440,
        8540,
        8640,
        8740,
        8840,
        8940,
        9040,
        9140,
        9240,
        9340,
        9440,
        9540,
        9640,
        9740,
        9840,
        9940
    },
})

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

```



---

### getRecoverIntervalTableMaster

회복 간격 테이블 마스터를 취득<br>

경험치 모델 연관과 랭크에서 회복 간격으로의 값 매핑을 포함하여, 지정된 회복 간격 테이블 마스터를 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| recoverIntervalTableName | string |  | ✓|  |  ~ 128자 | 회복 간격 테이블 이름<br>회복 간격 테이블 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverIntervalTableMaster](#recoverintervaltablemaster) | 회복 간격 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetRecoverIntervalTableMaster(
    &stamina.GetRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverIntervalTableName: pointy.String("recover-interval-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetRecoverIntervalTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getRecoverIntervalTableMaster(
        (new GetRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverIntervalTableName("recover-interval-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.GetRecoverIntervalTableMasterResult;

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

try {
    GetRecoverIntervalTableMasterResult result = client.getRecoverIntervalTableMaster(
        new GetRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
    );
    RecoverIntervalTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.GetRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.GetRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverIntervalTableName("recover-interval-table-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.getRecoverIntervalTableMaster(
        new Gs2Stamina.GetRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_recover_interval_table_master(
        stamina.GetRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_interval_table_name('recover-interval-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.get_recover_interval_table_master({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-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('stamina')

api_result_handler = client.get_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-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;

```



---

### updateRecoverIntervalTableMaster

회복 간격 테이블 마스터를 업데이트<br>

지정된 회복 간격 테이블 마스터의 설명, 메타데이터, 경험치 모델 연관, 랭크에서 회복 간격으로의 값 매핑을 업데이트합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| recoverIntervalTableName | string |  | ✓|  |  ~ 128자 | 회복 간격 테이블 이름<br>회복 간격 테이블 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓|  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복 간격이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓|  | 1 ~ 1024 items | 랭크별 회복 간격(분)<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복 간격 값(분 단위)의 배열.<br>인덱스 i의 값이 랭크 i의 플레이어의 회복 간격으로 사용되며, 모델의 기본값 recoverIntervalMinutes를 오버라이드합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverIntervalTableMaster](#recoverintervaltablemaster) | 업데이트한 회복 간격 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateRecoverIntervalTableMaster(
    &stamina.UpdateRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverIntervalTableName: pointy.String("recover-interval-table-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-1001"),
        Values: []*int32{
            pointy.Int32(40),
            pointy.Int32(190),
            pointy.Int32(340),
            pointy.Int32(490),
            pointy.Int32(640),
            pointy.Int32(790),
            pointy.Int32(940),
            pointy.Int32(1090),
            pointy.Int32(1240),
            pointy.Int32(1390),
            pointy.Int32(1540),
            pointy.Int32(1690),
            pointy.Int32(1840),
            pointy.Int32(1990),
            pointy.Int32(2140),
            pointy.Int32(2290),
            pointy.Int32(2440),
            pointy.Int32(2590),
            pointy.Int32(2740),
            pointy.Int32(2890),
            pointy.Int32(3040),
            pointy.Int32(3190),
            pointy.Int32(3340),
            pointy.Int32(3490),
            pointy.Int32(3640),
            pointy.Int32(3790),
            pointy.Int32(3940),
            pointy.Int32(4090),
            pointy.Int32(4240),
            pointy.Int32(4390),
            pointy.Int32(4540),
            pointy.Int32(4690),
            pointy.Int32(4840),
            pointy.Int32(4990),
            pointy.Int32(5140),
            pointy.Int32(5290),
            pointy.Int32(5440),
            pointy.Int32(5590),
            pointy.Int32(5740),
            pointy.Int32(5890),
            pointy.Int32(6040),
            pointy.Int32(6190),
            pointy.Int32(6340),
            pointy.Int32(6490),
            pointy.Int32(6640),
            pointy.Int32(6790),
            pointy.Int32(6940),
            pointy.Int32(7090),
            pointy.Int32(7240),
            pointy.Int32(7390),
            pointy.Int32(7540),
            pointy.Int32(7690),
            pointy.Int32(7840),
            pointy.Int32(7990),
            pointy.Int32(8140),
            pointy.Int32(8290),
            pointy.Int32(8440),
            pointy.Int32(8590),
            pointy.Int32(8740),
            pointy.Int32(8890),
            pointy.Int32(9040),
            pointy.Int32(9190),
            pointy.Int32(9340),
            pointy.Int32(9490),
            pointy.Int32(9640),
            pointy.Int32(9790),
            pointy.Int32(9940),
            pointy.Int32(10090),
            pointy.Int32(10240),
            pointy.Int32(10390),
            pointy.Int32(10540),
            pointy.Int32(10690),
            pointy.Int32(10840),
            pointy.Int32(10990),
            pointy.Int32(11140),
            pointy.Int32(11290),
            pointy.Int32(11440),
            pointy.Int32(11590),
            pointy.Int32(11740),
            pointy.Int32(11890),
            pointy.Int32(12040),
            pointy.Int32(12190),
            pointy.Int32(12340),
            pointy.Int32(12490),
            pointy.Int32(12640),
            pointy.Int32(12790),
            pointy.Int32(12940),
            pointy.Int32(13090),
            pointy.Int32(13240),
            pointy.Int32(13390),
            pointy.Int32(13540),
            pointy.Int32(13690),
            pointy.Int32(13840),
            pointy.Int32(13990),
            pointy.Int32(14140),
            pointy.Int32(14290),
            pointy.Int32(14440),
            pointy.Int32(14590),
            pointy.Int32(14740),
            pointy.Int32(14890),
        },
    }
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateRecoverIntervalTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateRecoverIntervalTableMaster(
        (new UpdateRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverIntervalTableName("recover-interval-table-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-1001")
            ->withValues([
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890,
            ])
    );
    $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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.UpdateRecoverIntervalTableMasterResult;

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

try {
    UpdateRecoverIntervalTableMasterResult result = client.updateRecoverIntervalTableMaster(
        new UpdateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues(Arrays.asList(
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890
            ))
    );
    RecoverIntervalTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.UpdateRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.UpdateRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverIntervalTableName("recover-interval-table-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-1001")
        .WithValues(new int[] {
            40,
            190,
            340,
            490,
            640,
            790,
            940,
            1090,
            1240,
            1390,
            1540,
            1690,
            1840,
            1990,
            2140,
            2290,
            2440,
            2590,
            2740,
            2890,
            3040,
            3190,
            3340,
            3490,
            3640,
            3790,
            3940,
            4090,
            4240,
            4390,
            4540,
            4690,
            4840,
            4990,
            5140,
            5290,
            5440,
            5590,
            5740,
            5890,
            6040,
            6190,
            6340,
            6490,
            6640,
            6790,
            6940,
            7090,
            7240,
            7390,
            7540,
            7690,
            7840,
            7990,
            8140,
            8290,
            8440,
            8590,
            8740,
            8890,
            9040,
            9190,
            9340,
            9490,
            9640,
            9790,
            9940,
            10090,
            10240,
            10390,
            10540,
            10690,
            10840,
            10990,
            11140,
            11290,
            11440,
            11590,
            11740,
            11890,
            12040,
            12190,
            12340,
            12490,
            12640,
            12790,
            12940,
            13090,
            13240,
            13390,
            13540,
            13690,
            13840,
            13990,
            14140,
            14290,
            14440,
            14590,
            14740,
            14890,
        }),
    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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.updateRecoverIntervalTableMaster(
        new Gs2Stamina.UpdateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues([
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890,
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.update_recover_interval_table_master(
        stamina.UpdateRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_interval_table_name('recover-interval-table-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-1001')
            .with_values([
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.update_recover_interval_table_master({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        40,
        190,
        340,
        490,
        640,
        790,
        940,
        1090,
        1240,
        1390,
        1540,
        1690,
        1840,
        1990,
        2140,
        2290,
        2440,
        2590,
        2740,
        2890,
        3040,
        3190,
        3340,
        3490,
        3640,
        3790,
        3940,
        4090,
        4240,
        4390,
        4540,
        4690,
        4840,
        4990,
        5140,
        5290,
        5440,
        5590,
        5740,
        5890,
        6040,
        6190,
        6340,
        6490,
        6640,
        6790,
        6940,
        7090,
        7240,
        7390,
        7540,
        7690,
        7840,
        7990,
        8140,
        8290,
        8440,
        8590,
        8740,
        8890,
        9040,
        9190,
        9340,
        9490,
        9640,
        9790,
        9940,
        10090,
        10240,
        10390,
        10540,
        10690,
        10840,
        10990,
        11140,
        11290,
        11440,
        11590,
        11740,
        11890,
        12040,
        12190,
        12340,
        12490,
        12640,
        12790,
        12940,
        13090,
        13240,
        13390,
        13540,
        13690,
        13840,
        13990,
        14140,
        14290,
        14440,
        14590,
        14740,
        14890
    },
})

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

api_result_handler = client.update_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        40,
        190,
        340,
        490,
        640,
        790,
        940,
        1090,
        1240,
        1390,
        1540,
        1690,
        1840,
        1990,
        2140,
        2290,
        2440,
        2590,
        2740,
        2890,
        3040,
        3190,
        3340,
        3490,
        3640,
        3790,
        3940,
        4090,
        4240,
        4390,
        4540,
        4690,
        4840,
        4990,
        5140,
        5290,
        5440,
        5590,
        5740,
        5890,
        6040,
        6190,
        6340,
        6490,
        6640,
        6790,
        6940,
        7090,
        7240,
        7390,
        7540,
        7690,
        7840,
        7990,
        8140,
        8290,
        8440,
        8590,
        8740,
        8890,
        9040,
        9190,
        9340,
        9490,
        9640,
        9790,
        9940,
        10090,
        10240,
        10390,
        10540,
        10690,
        10840,
        10990,
        11140,
        11290,
        11440,
        11590,
        11740,
        11890,
        12040,
        12190,
        12340,
        12490,
        12640,
        12790,
        12940,
        13090,
        13240,
        13390,
        13540,
        13690,
        13840,
        13990,
        14140,
        14290,
        14440,
        14590,
        14740,
        14890
    },
})

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

```



---

### deleteRecoverIntervalTableMaster

회복 간격 테이블 마스터를 삭제<br>

지정된 회복 간격 테이블 마스터를 삭제합니다. 이는 마스터 정의만을 삭제하며, 현재 활성화된 스태미나 설정에는 영향을 주지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| recoverIntervalTableName | string |  | ✓|  |  ~ 128자 | 회복 간격 테이블 이름<br>회복 간격 테이블 고유의 이름. 영숫자 및 -(하이픈) _(밑줄) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverIntervalTableMaster](#recoverintervaltablemaster) | 삭제한 회복 간격 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DeleteRecoverIntervalTableMaster(
    &stamina.DeleteRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverIntervalTableName: pointy.String("recover-interval-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteRecoverIntervalTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteRecoverIntervalTableMaster(
        (new DeleteRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverIntervalTableName("recover-interval-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.DeleteRecoverIntervalTableMasterResult;

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

try {
    DeleteRecoverIntervalTableMasterResult result = client.deleteRecoverIntervalTableMaster(
        new DeleteRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
    );
    RecoverIntervalTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.DeleteRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.DeleteRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverIntervalTableName("recover-interval-table-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.deleteRecoverIntervalTableMaster(
        new Gs2Stamina.DeleteRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.delete_recover_interval_table_master(
        stamina.DeleteRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_interval_table_name('recover-interval-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.delete_recover_interval_table_master({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-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('stamina')

api_result_handler = client.delete_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-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;

```



---

### describeRecoverValueTableMasters

스태미나 회복량 테이블 마스터 목록 가져오기<br>

스태미나 회복량 테이블 마스터의 페이지네이션 리스트를 가져옵니다. 이름의 접두사로 필터링할 수 있습니다. 이 테이블들은 경험치 랭크 값을 간격별 스태미나 회복량에 매핑하여 레벨 기반의 회복량 스케일링을 가능하게 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 스태미나 회복량 테이블 이름의 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;RecoverValueTableMaster&gt;](#recovervaluetablemaster) | 스태미나 회복량 테이블 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DescribeRecoverValueTableMasters(
    &stamina.DescribeRecoverValueTableMastersRequest {
        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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeRecoverValueTableMastersRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeRecoverValueTableMasters(
        (new DescribeRecoverValueTableMastersRequest())
            ->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeRecoverValueTableMastersRequest;
import io.gs2.stamina.result.DescribeRecoverValueTableMastersResult;

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

try {
    DescribeRecoverValueTableMastersResult result = client.describeRecoverValueTableMasters(
        new DescribeRecoverValueTableMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RecoverValueTableMaster> 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeRecoverValueTableMastersResult> asyncResult = null;
yield return client.DescribeRecoverValueTableMasters(
    new Gs2.Gs2Stamina.Request.DescribeRecoverValueTableMastersRequest()
        .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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.describeRecoverValueTableMasters(
        new Gs2Stamina.DescribeRecoverValueTableMastersRequest()
            .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 stamina

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

try:
    result = client.describe_recover_value_table_masters(
        stamina.DescribeRecoverValueTableMastersRequest()
            .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('stamina')

api_result = client.describe_recover_value_table_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('stamina')

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

```



---

### createRecoverValueTableMaster

스태미나 회복량 테이블 마스터 신규 생성<br>

경험치 모델 ID와 값 배열을 가진 새로운 스태미나 회복량 테이블 마스터를 생성합니다. 값 배열은 경험치 랭크로 인덱싱되며, 각 랭크를 해당하는 간격별 회복량에 매핑합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 스태미나 회복량 테이블 이름<br>스태미나 회복량 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓|  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복량이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓|  | 1 ~ 1024 items | 랭크별 회복량<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복량 값의 배열입니다.<br>인덱스 i의 값은 랭크 i의 플레이어에 대한 틱당 회복량으로 사용되며, 모델의 기본 recoverValue를 오버라이드합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverValueTableMaster](#recovervaluetablemaster) | 생성한 스태미나 회복량 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateRecoverValueTableMaster(
    &stamina.CreateRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("recover-value-table-0001"),
        Description: nil,
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-0001"),
        Values: []*int32{
            pointy.Int32(30),
            pointy.Int32(130),
            pointy.Int32(230),
            pointy.Int32(330),
            pointy.Int32(430),
            pointy.Int32(530),
            pointy.Int32(630),
            pointy.Int32(730),
            pointy.Int32(830),
            pointy.Int32(930),
            pointy.Int32(1030),
            pointy.Int32(1130),
            pointy.Int32(1230),
            pointy.Int32(1330),
            pointy.Int32(1430),
            pointy.Int32(1530),
            pointy.Int32(1630),
            pointy.Int32(1730),
            pointy.Int32(1830),
            pointy.Int32(1930),
            pointy.Int32(2030),
            pointy.Int32(2130),
            pointy.Int32(2230),
            pointy.Int32(2330),
            pointy.Int32(2430),
            pointy.Int32(2530),
            pointy.Int32(2630),
            pointy.Int32(2730),
            pointy.Int32(2830),
            pointy.Int32(2930),
            pointy.Int32(3030),
            pointy.Int32(3130),
            pointy.Int32(3230),
            pointy.Int32(3330),
            pointy.Int32(3430),
            pointy.Int32(3530),
            pointy.Int32(3630),
            pointy.Int32(3730),
            pointy.Int32(3830),
            pointy.Int32(3930),
            pointy.Int32(4030),
            pointy.Int32(4130),
            pointy.Int32(4230),
            pointy.Int32(4330),
            pointy.Int32(4430),
            pointy.Int32(4530),
            pointy.Int32(4630),
            pointy.Int32(4730),
            pointy.Int32(4830),
            pointy.Int32(4930),
            pointy.Int32(5030),
            pointy.Int32(5130),
            pointy.Int32(5230),
            pointy.Int32(5330),
            pointy.Int32(5430),
            pointy.Int32(5530),
            pointy.Int32(5630),
            pointy.Int32(5730),
            pointy.Int32(5830),
            pointy.Int32(5930),
            pointy.Int32(6030),
            pointy.Int32(6130),
            pointy.Int32(6230),
            pointy.Int32(6330),
            pointy.Int32(6430),
            pointy.Int32(6530),
            pointy.Int32(6630),
            pointy.Int32(6730),
            pointy.Int32(6830),
            pointy.Int32(6930),
            pointy.Int32(7030),
            pointy.Int32(7130),
            pointy.Int32(7230),
            pointy.Int32(7330),
            pointy.Int32(7430),
            pointy.Int32(7530),
            pointy.Int32(7630),
            pointy.Int32(7730),
            pointy.Int32(7830),
            pointy.Int32(7930),
            pointy.Int32(8030),
            pointy.Int32(8130),
            pointy.Int32(8230),
            pointy.Int32(8330),
            pointy.Int32(8430),
            pointy.Int32(8530),
            pointy.Int32(8630),
            pointy.Int32(8730),
            pointy.Int32(8830),
            pointy.Int32(8930),
            pointy.Int32(9030),
            pointy.Int32(9130),
            pointy.Int32(9230),
            pointy.Int32(9330),
            pointy.Int32(9430),
            pointy.Int32(9530),
            pointy.Int32(9630),
            pointy.Int32(9730),
            pointy.Int32(9830),
            pointy.Int32(9930),
        },
    }
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateRecoverValueTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createRecoverValueTableMaster(
        (new CreateRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("recover-value-table-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-0001")
            ->withValues([
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930,
            ])
    );
    $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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateRecoverValueTableMasterRequest;
import io.gs2.stamina.result.CreateRecoverValueTableMasterResult;

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

try {
    CreateRecoverValueTableMasterResult result = client.createRecoverValueTableMaster(
        new CreateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-value-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues(Arrays.asList(
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930
            ))
    );
    RecoverValueTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateRecoverValueTableMasterResult> asyncResult = null;
yield return client.CreateRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.CreateRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("recover-value-table-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-0001")
        .WithValues(new int[] {
            30,
            130,
            230,
            330,
            430,
            530,
            630,
            730,
            830,
            930,
            1030,
            1130,
            1230,
            1330,
            1430,
            1530,
            1630,
            1730,
            1830,
            1930,
            2030,
            2130,
            2230,
            2330,
            2430,
            2530,
            2630,
            2730,
            2830,
            2930,
            3030,
            3130,
            3230,
            3330,
            3430,
            3530,
            3630,
            3730,
            3830,
            3930,
            4030,
            4130,
            4230,
            4330,
            4430,
            4530,
            4630,
            4730,
            4830,
            4930,
            5030,
            5130,
            5230,
            5330,
            5430,
            5530,
            5630,
            5730,
            5830,
            5930,
            6030,
            6130,
            6230,
            6330,
            6430,
            6530,
            6630,
            6730,
            6830,
            6930,
            7030,
            7130,
            7230,
            7330,
            7430,
            7530,
            7630,
            7730,
            7830,
            7930,
            8030,
            8130,
            8230,
            8330,
            8430,
            8530,
            8630,
            8730,
            8830,
            8930,
            9030,
            9130,
            9230,
            9330,
            9430,
            9530,
            9630,
            9730,
            9830,
            9930,
        }),
    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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.createRecoverValueTableMaster(
        new Gs2Stamina.CreateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-value-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues([
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930,
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.create_recover_value_table_master(
        stamina.CreateRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('recover-value-table-0001')
            .with_description(None)
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-0001')
            .with_values([
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.create_recover_value_table_master({
    namespaceName="namespace-0001",
    name="recover-value-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        30,
        130,
        230,
        330,
        430,
        530,
        630,
        730,
        830,
        930,
        1030,
        1130,
        1230,
        1330,
        1430,
        1530,
        1630,
        1730,
        1830,
        1930,
        2030,
        2130,
        2230,
        2330,
        2430,
        2530,
        2630,
        2730,
        2830,
        2930,
        3030,
        3130,
        3230,
        3330,
        3430,
        3530,
        3630,
        3730,
        3830,
        3930,
        4030,
        4130,
        4230,
        4330,
        4430,
        4530,
        4630,
        4730,
        4830,
        4930,
        5030,
        5130,
        5230,
        5330,
        5430,
        5530,
        5630,
        5730,
        5830,
        5930,
        6030,
        6130,
        6230,
        6330,
        6430,
        6530,
        6630,
        6730,
        6830,
        6930,
        7030,
        7130,
        7230,
        7330,
        7430,
        7530,
        7630,
        7730,
        7830,
        7930,
        8030,
        8130,
        8230,
        8330,
        8430,
        8530,
        8630,
        8730,
        8830,
        8930,
        9030,
        9130,
        9230,
        9330,
        9430,
        9530,
        9630,
        9730,
        9830,
        9930
    },
})

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

api_result_handler = client.create_recover_value_table_master_async({
    namespaceName="namespace-0001",
    name="recover-value-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        30,
        130,
        230,
        330,
        430,
        530,
        630,
        730,
        830,
        930,
        1030,
        1130,
        1230,
        1330,
        1430,
        1530,
        1630,
        1730,
        1830,
        1930,
        2030,
        2130,
        2230,
        2330,
        2430,
        2530,
        2630,
        2730,
        2830,
        2930,
        3030,
        3130,
        3230,
        3330,
        3430,
        3530,
        3630,
        3730,
        3830,
        3930,
        4030,
        4130,
        4230,
        4330,
        4430,
        4530,
        4630,
        4730,
        4830,
        4930,
        5030,
        5130,
        5230,
        5330,
        5430,
        5530,
        5630,
        5730,
        5830,
        5930,
        6030,
        6130,
        6230,
        6330,
        6430,
        6530,
        6630,
        6730,
        6830,
        6930,
        7030,
        7130,
        7230,
        7330,
        7430,
        7530,
        7630,
        7730,
        7830,
        7930,
        8030,
        8130,
        8230,
        8330,
        8430,
        8530,
        8630,
        8730,
        8830,
        8930,
        9030,
        9130,
        9230,
        9330,
        9430,
        9530,
        9630,
        9730,
        9830,
        9930
    },
})

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

```



---

### getRecoverValueTableMaster

스태미나 회복량 테이블 마스터 가져오기<br>

경험치 모델 연관 정보와 랭크에서 회복량으로의 값 매핑을 포함하여, 지정된 스태미나 회복량 테이블 마스터를 가져옵니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| recoverValueTableName | string |  | ✓|  |  ~ 128자 | 스태미나 회복량 테이블 이름<br>스태미나 회복량 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverValueTableMaster](#recovervaluetablemaster) | 스태미나 회복량 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetRecoverValueTableMaster(
    &stamina.GetRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverValueTableName: pointy.String("recover-value-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetRecoverValueTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getRecoverValueTableMaster(
        (new GetRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverValueTableName("recover-value-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetRecoverValueTableMasterRequest;
import io.gs2.stamina.result.GetRecoverValueTableMasterResult;

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

try {
    GetRecoverValueTableMasterResult result = client.getRecoverValueTableMaster(
        new GetRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
    );
    RecoverValueTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetRecoverValueTableMasterResult> asyncResult = null;
yield return client.GetRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.GetRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverValueTableName("recover-value-table-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.getRecoverValueTableMaster(
        new Gs2Stamina.GetRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.get_recover_value_table_master(
        stamina.GetRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_value_table_name('recover-value-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.get_recover_value_table_master({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-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('stamina')

api_result_handler = client.get_recover_value_table_master_async({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-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;

```



---

### updateRecoverValueTableMaster

스태미나 회복량 테이블 마스터 갱신<br>

지정된 스태미나 회복량 테이블 마스터의 설명, 메타데이터, 경험치 모델 연관 정보, 랭크에서 회복량으로의 값 매핑을 갱신합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| recoverValueTableName | string |  | ✓|  |  ~ 128자 | 스태미나 회복량 테이블 이름<br>스태미나 회복량 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 128자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| experienceModelId | string |  | ✓|  |  ~ 1024자 | 경험치 모델 ID<br>플레이어의 현재 랭크를 참조하기 위해 사용하는 GS2-Experience의 ExperienceModel의 GRN.<br>랭크 인덱스가 values 목록의 배열 인덱스로 사용되어, 사용자별 회복량이 결정됩니다. |
| values | List&lt;int&gt; |  | ✓|  | 1 ~ 1024 items | 랭크별 회복량<br>플레이어의 GS2-Experience 랭크 인덱스로 색인되는 회복량 값의 배열입니다.<br>인덱스 i의 값은 랭크 i의 플레이어에 대한 틱당 회복량으로 사용되며, 모델의 기본 recoverValue를 오버라이드합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverValueTableMaster](#recovervaluetablemaster) | 갱신한 스태미나 회복량 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.UpdateRecoverValueTableMaster(
    &stamina.UpdateRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverValueTableName: pointy.String("recover-value-table-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-1001"),
        Values: []*int32{
            pointy.Int32(30),
            pointy.Int32(180),
            pointy.Int32(330),
            pointy.Int32(480),
            pointy.Int32(630),
            pointy.Int32(780),
            pointy.Int32(930),
            pointy.Int32(1080),
            pointy.Int32(1230),
            pointy.Int32(1380),
            pointy.Int32(1530),
            pointy.Int32(1680),
            pointy.Int32(1830),
            pointy.Int32(1980),
            pointy.Int32(2130),
            pointy.Int32(2280),
            pointy.Int32(2430),
            pointy.Int32(2580),
            pointy.Int32(2730),
            pointy.Int32(2880),
            pointy.Int32(3030),
            pointy.Int32(3180),
            pointy.Int32(3330),
            pointy.Int32(3480),
            pointy.Int32(3630),
            pointy.Int32(3780),
            pointy.Int32(3930),
            pointy.Int32(4080),
            pointy.Int32(4230),
            pointy.Int32(4380),
            pointy.Int32(4530),
            pointy.Int32(4680),
            pointy.Int32(4830),
            pointy.Int32(4980),
            pointy.Int32(5130),
            pointy.Int32(5280),
            pointy.Int32(5430),
            pointy.Int32(5580),
            pointy.Int32(5730),
            pointy.Int32(5880),
            pointy.Int32(6030),
            pointy.Int32(6180),
            pointy.Int32(6330),
            pointy.Int32(6480),
            pointy.Int32(6630),
            pointy.Int32(6780),
            pointy.Int32(6930),
            pointy.Int32(7080),
            pointy.Int32(7230),
            pointy.Int32(7380),
            pointy.Int32(7530),
            pointy.Int32(7680),
            pointy.Int32(7830),
            pointy.Int32(7980),
            pointy.Int32(8130),
            pointy.Int32(8280),
            pointy.Int32(8430),
            pointy.Int32(8580),
            pointy.Int32(8730),
            pointy.Int32(8880),
            pointy.Int32(9030),
            pointy.Int32(9180),
            pointy.Int32(9330),
            pointy.Int32(9480),
            pointy.Int32(9630),
            pointy.Int32(9780),
            pointy.Int32(9930),
            pointy.Int32(10080),
            pointy.Int32(10230),
            pointy.Int32(10380),
            pointy.Int32(10530),
            pointy.Int32(10680),
            pointy.Int32(10830),
            pointy.Int32(10980),
            pointy.Int32(11130),
            pointy.Int32(11280),
            pointy.Int32(11430),
            pointy.Int32(11580),
            pointy.Int32(11730),
            pointy.Int32(11880),
            pointy.Int32(12030),
            pointy.Int32(12180),
            pointy.Int32(12330),
            pointy.Int32(12480),
            pointy.Int32(12630),
            pointy.Int32(12780),
            pointy.Int32(12930),
            pointy.Int32(13080),
            pointy.Int32(13230),
            pointy.Int32(13380),
            pointy.Int32(13530),
            pointy.Int32(13680),
            pointy.Int32(13830),
            pointy.Int32(13980),
            pointy.Int32(14130),
            pointy.Int32(14280),
            pointy.Int32(14430),
            pointy.Int32(14580),
            pointy.Int32(14730),
            pointy.Int32(14880),
        },
    }
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateRecoverValueTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateRecoverValueTableMaster(
        (new UpdateRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverValueTableName("recover-value-table-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-1001")
            ->withValues([
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880,
            ])
    );
    $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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateRecoverValueTableMasterRequest;
import io.gs2.stamina.result.UpdateRecoverValueTableMasterResult;

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

try {
    UpdateRecoverValueTableMasterResult result = client.updateRecoverValueTableMaster(
        new UpdateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues(Arrays.asList(
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880
            ))
    );
    RecoverValueTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateRecoverValueTableMasterResult> asyncResult = null;
yield return client.UpdateRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.UpdateRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverValueTableName("recover-value-table-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-1001")
        .WithValues(new int[] {
            30,
            180,
            330,
            480,
            630,
            780,
            930,
            1080,
            1230,
            1380,
            1530,
            1680,
            1830,
            1980,
            2130,
            2280,
            2430,
            2580,
            2730,
            2880,
            3030,
            3180,
            3330,
            3480,
            3630,
            3780,
            3930,
            4080,
            4230,
            4380,
            4530,
            4680,
            4830,
            4980,
            5130,
            5280,
            5430,
            5580,
            5730,
            5880,
            6030,
            6180,
            6330,
            6480,
            6630,
            6780,
            6930,
            7080,
            7230,
            7380,
            7530,
            7680,
            7830,
            7980,
            8130,
            8280,
            8430,
            8580,
            8730,
            8880,
            9030,
            9180,
            9330,
            9480,
            9630,
            9780,
            9930,
            10080,
            10230,
            10380,
            10530,
            10680,
            10830,
            10980,
            11130,
            11280,
            11430,
            11580,
            11730,
            11880,
            12030,
            12180,
            12330,
            12480,
            12630,
            12780,
            12930,
            13080,
            13230,
            13380,
            13530,
            13680,
            13830,
            13980,
            14130,
            14280,
            14430,
            14580,
            14730,
            14880,
        }),
    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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.updateRecoverValueTableMaster(
        new Gs2Stamina.UpdateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues([
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880,
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.update_recover_value_table_master(
        stamina.UpdateRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_value_table_name('recover-value-table-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-1001')
            .with_values([
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.update_recover_value_table_master({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        30,
        180,
        330,
        480,
        630,
        780,
        930,
        1080,
        1230,
        1380,
        1530,
        1680,
        1830,
        1980,
        2130,
        2280,
        2430,
        2580,
        2730,
        2880,
        3030,
        3180,
        3330,
        3480,
        3630,
        3780,
        3930,
        4080,
        4230,
        4380,
        4530,
        4680,
        4830,
        4980,
        5130,
        5280,
        5430,
        5580,
        5730,
        5880,
        6030,
        6180,
        6330,
        6480,
        6630,
        6780,
        6930,
        7080,
        7230,
        7380,
        7530,
        7680,
        7830,
        7980,
        8130,
        8280,
        8430,
        8580,
        8730,
        8880,
        9030,
        9180,
        9330,
        9480,
        9630,
        9780,
        9930,
        10080,
        10230,
        10380,
        10530,
        10680,
        10830,
        10980,
        11130,
        11280,
        11430,
        11580,
        11730,
        11880,
        12030,
        12180,
        12330,
        12480,
        12630,
        12780,
        12930,
        13080,
        13230,
        13380,
        13530,
        13680,
        13830,
        13980,
        14130,
        14280,
        14430,
        14580,
        14730,
        14880
    },
})

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

api_result_handler = client.update_recover_value_table_master_async({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        30,
        180,
        330,
        480,
        630,
        780,
        930,
        1080,
        1230,
        1380,
        1530,
        1680,
        1830,
        1980,
        2130,
        2280,
        2430,
        2580,
        2730,
        2880,
        3030,
        3180,
        3330,
        3480,
        3630,
        3780,
        3930,
        4080,
        4230,
        4380,
        4530,
        4680,
        4830,
        4980,
        5130,
        5280,
        5430,
        5580,
        5730,
        5880,
        6030,
        6180,
        6330,
        6480,
        6630,
        6780,
        6930,
        7080,
        7230,
        7380,
        7530,
        7680,
        7830,
        7980,
        8130,
        8280,
        8430,
        8580,
        8730,
        8880,
        9030,
        9180,
        9330,
        9480,
        9630,
        9780,
        9930,
        10080,
        10230,
        10380,
        10530,
        10680,
        10830,
        10980,
        11130,
        11280,
        11430,
        11580,
        11730,
        11880,
        12030,
        12180,
        12330,
        12480,
        12630,
        12780,
        12930,
        13080,
        13230,
        13380,
        13530,
        13680,
        13830,
        13980,
        14130,
        14280,
        14430,
        14580,
        14730,
        14880
    },
})

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

```



---

### deleteRecoverValueTableMaster

스태미나 회복량 테이블 마스터 삭제<br>

지정된 스태미나 회복량 테이블 마스터를 삭제합니다. 이는 마스터 정의만 삭제하며, 현재 활성화된 스태미나 설정에는 영향을 주지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| recoverValueTableName | string |  | ✓|  |  ~ 128자 | 스태미나 회복량 테이블 이름<br>스태미나 회복량 테이블 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [RecoverValueTableMaster](#recovervaluetablemaster) | 삭제한 스태미나 회복량 테이블 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DeleteRecoverValueTableMaster(
    &stamina.DeleteRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverValueTableName: pointy.String("recover-value-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteRecoverValueTableMasterRequest;

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

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteRecoverValueTableMaster(
        (new DeleteRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverValueTableName("recover-value-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteRecoverValueTableMasterRequest;
import io.gs2.stamina.result.DeleteRecoverValueTableMasterResult;

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

try {
    DeleteRecoverValueTableMasterResult result = client.deleteRecoverValueTableMaster(
        new DeleteRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
    );
    RecoverValueTableMaster 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 Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteRecoverValueTableMasterResult> asyncResult = null;
yield return client.DeleteRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.DeleteRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverValueTableName("recover-value-table-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 Gs2Stamina from '@/gs2/stamina';

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

try {
    const result = await client.deleteRecoverValueTableMaster(
        new Gs2Stamina.DeleteRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import stamina

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

try:
    result = client.delete_recover_value_table_master(
        stamina.DeleteRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_value_table_name('recover-value-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('stamina')

api_result = client.delete_recover_value_table_master({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-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('stamina')

api_result_handler = client.delete_recover_value_table_master_async({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-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;

```



---



