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

# GS2-Limit SDK API 레퍼런스

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



## 모델

### Namespace

네임스페이스<br>

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

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


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024자 | 네임스페이스 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  |  |  |  | 트랜잭션 설정<br>카운트업이나 카운터 리셋 등 사용 횟수 제한 조작 시 트랜잭션 처리 방식을 제어하는 설정입니다. |
| countUpScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 카운트업 시 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`countUp`](../script/#countup) |
| logSetting | [LogSetting](#logsetting) |  |  |  |  | 로그 출력 설정<br>사용 횟수 제한 조작의 API 요청·응답 로그를 출력하기 위한 GS2-Log 네임스페이스를 지정합니다. 디버그나 분석을 위해 카운터의 증가, 리셋, 제한 확인을 추적하는 데 유용합니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

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



---

### TransactionSetting

트랜잭션 설정<br>

트랜잭션 설정은 트랜잭션의 실행 방법·정합성·비동기 처리·충돌 회피 메커니즘을 제어하는 설정입니다.<br>
자동 실행(AutoRun), 원자적 실행(AtomicCommit), GS2-Distributor를 이용한 비동기 실행, 스크립트 결과의 일괄 적용, GS2-JobQueue를 통한 입수 액션의 비동기화 등을 조합하여 게임 로직에 맞는 견고한 트랜잭션 관리를 가능하게 합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| enableAutoRun | bool |  |  | false |  | 발행한 트랜잭션을 서버 사이드에서 자동으로 실행할지 여부 |
| enableAtomicCommit | bool | {enableAutoRun} == true |  | false |  | 트랜잭션의 실행을 원자적으로 커밋할지 여부<br>※ enableAutoRun이(가) true 이면 활성화 |
| transactionUseDistributor | bool | {enableAtomicCommit} == true |  | false |  | 트랜잭션을 비동기 처리로 실행할지 여부<br>※ enableAtomicCommit이(가) true 이면 활성화 |
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true |  | false |  | 스크립트의 결과 커밋 처리를 비동기 처리로 실행할지 여부<br>※ transactionUseDistributor이(가) true 이면 활성화 |
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true |  | false |  | 입수 액션을 실행할 때 GS2-JobQueue를 사용할지 여부<br>※ enableAtomicCommit이(가) true 이면 활성화 |
| distributorNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:distributor:default" |  ~ 1024자 | 트랜잭션 실행에 사용하는 GS2-Distributor 네임스페이스GRN |
| queueNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:queue:default" |  ~ 1024자 | 트랜잭션 실행에 사용하는 GS2-JobQueue의 네임스페이스GRN |

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


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



---

### ScriptSetting

스크립트 설정<br>

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

스크립트 실행 방식은 크게 두 가지로, 바로 "동기 실행"과 "비동기 실행"입니다.<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" 이면 활성화 |

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


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



---

### LogSetting

로그 출력 설정<br>

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


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

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


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



---

### GitHubCheckoutSetting

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


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

**관련 메서드:**
updateCurrentLimitMasterFromGitHub - 현재 활성화되어 있는 횟수 제한 모델 마스터를 GitHub에서 갱신



---

### Counter

사용 횟수 제한의 현재 값<br>

각 사용자의 사용 횟수 제한 모델에 속한 특정 카운터의 현재 사용 횟수를 추적합니다. 하나의 사용 횟수 제한 모델 아래에 여러 카운터를 만들 수 있습니다(예: 1회 한정 보상을 위해 퀘스트마다 하나의 카운터). 카운트 값은 카운트업 조작 시 지정되는 최대값과 비교되며, 사용 횟수 제한 모델의 리셋 일정에 따라 자동으로 0으로 리셋됩니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| counterId | string |  | ※ |  |  ~ 1024자 | 카운터 GRN<br>※ 서버가 자동으로 설정 |
| limitName | string |  | ✓ |  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| name | string |  | ✓ |  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| count | int |  |  | 0 | 0 ~ 2147483646 | 카운트 값<br>이 카운터의 현재 사용 횟수입니다. countUp 조작으로 증가하며, 이때 지정된 최대값과 비교됩니다. 사용 횟수 제한 모델의 리셋 시점에 도달하면 자동으로 0으로 리셋됩니다. |
| nextResetAt | long |  |  |  |  | 다음 리셋 시점<br>사용 횟수 제한 모델의 리셋 일정으로부터 계산된, 이 카운터가 다음에 0으로 리셋되는 타임스탬프입니다. "notReset" 타입인 경우 이 값은 설정되지 않습니다. 각 리셋이 발생한 후 자동으로 다시 계산됩니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeCounters - 카운터 목록 조회
describeCountersByUserId - 사용자 ID를 지정하여 카운터 목록 조회
getCounter - 카운터 조회
getCounterByUserId - 사용자 ID를 지정하여 카운터 조회
countUp - 카운트업
countUpByUserId - 사용자 ID를 지정하여 카운트업
countDownByUserId - 사용자 ID를 지정하여 카운트다운
deleteCounterByUserId - 사용자 ID를 지정하여 카운터 삭제
verifyCounter - 카운터 값 검증
verifyCounterByUserId - 사용자 ID를 지정하여 카운터 값 검증



---

### LimitModel

횟수 제한 모델<br>

횟수 제한 모델에는 사용 횟수를 리셋하는 타이밍을 설정할 수 있습니다.<br>
리셋 간격은 "매일", "매주", "매월", "리셋하지 않음", "일정 일수마다" 5가지 중에서 선택할 수 있습니다.<br>

또한, 횟수 제한의 최대값은 마스터 데이터 쪽에서는 고정하지 않습니다.<br>
이는 게임 내 컨텍스트에 따라 허용되는 최대 횟수를 동적으로 변경할 수 있도록 하기 위함입니다.<br>
예를 들어 스텝업 가챠처럼,<br>
- 구매 횟수 카운터가 3회 미만일 때 구매할 수 있는 상품<br>
- 위 상품을 구매할 수 없을 때, 구매 횟수 카운터가 5회 미만이면 구매할 수 있는 다른 상품<br>

과 같이, 상황에 따라 "최대 횟수"를 전환할 수 있는 설계를 상정하고 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| limitModelId | string |  | ※ |  |  ~ 1024자 | 횟수 제한 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 횟수 제한 모델명<br>횟수 제한 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| resetType | 문자열 열거형<br>enum {<br>"notReset",<br>"daily",<br>"weekly",<br>"monthly",<br>"days"<br>}<br> |  | ✓ |  |  | 리셋 타이밍<br>이 횟수 제한 모델 하위의 카운터 값이 자동으로 0으로 리셋되는 타이밍을 결정합니다. notReset(영구적, 리셋 없음), daily(매일 지정된 시각에 리셋), weekly(지정된 요일에 리셋), monthly(지정된 날짜에 리셋), days(기준 일시로부터 일정 일수마다 리셋) 중에서 선택합니다. 모든 시각은 UTC입니다.notReset: 리셋 안 함 / daily: 매일 / weekly: 매주 / monthly: 매월 / days: 일정 일수마다 /  |
| resetDayOfMonth | int | {resetType} == "monthly" | ✓※ |  | 1 ~ 31 | 리셋 날짜<br>resetType이 "monthly"인 경우 카운터가 리셋되는 날짜(일)입니다. 1~31 사이의 값이 유효합니다. 지정한 날짜가 해당 월의 일수를 초과하는 경우(예: 2월의 31일), 해당 월의 마지막 날에 리셋됩니다.<br>※ resetType이(가) "monthly" 이면 필수 |
| resetDayOfWeek | 문자열 열거형<br>enum {<br>"sunday",<br>"monday",<br>"tuesday",<br>"wednesday",<br>"thursday",<br>"friday",<br>"saturday"<br>}<br> | {resetType} == "weekly" | ✓※ |  |  | 리셋 요일<br>resetType이 "weekly"인 경우 카운터가 리셋되는 요일입니다. 이 요일의 resetHour(UTC)로 지정된 시각에 리셋됩니다.sunday: 일요일 / monday: 월요일 / tuesday: 화요일 / wednesday: 수요일 / thursday: 목요일 / friday: 금요일 / saturday: 토요일 / <br>※ resetType이(가) "weekly" 이면 필수 |
| resetHour | int | {resetType} in ["monthly", "weekly", "daily"] | ✓※ |  | 0 ~ 23 | 리셋 시각<br>daily, weekly, monthly 리셋 타입에서 카운터가 리셋되는 UTC 시각(0~23)입니다. 예를 들어 값이 0이면 UTC 자정에 카운터가 리셋됩니다.<br>※ resetType이(가) "monthly","weekly","daily"이면 필수 |
| anchorTimestamp | long | {resetType} == "days" | ✓※ |  |  | 경과 일수를 계산하는 기준 일시<br>UNIX 시간(밀리초)<br>※ resetType이(가) "days" 이면 필수 |
| days | int | {resetType} == "days" | ✓※ |  | 1 ~ 2147483646 | 리셋 일수<br>resetType이 "days"인 경우 카운터 리셋 간격(일수)입니다. 리셋 주기는 anchorTimestamp를 기준으로 계산됩니다. 예를 들어 days가 7이고 anchorTimestamp가 월요일 정오라면, 매주 월요일 정오에 카운터가 리셋됩니다.<br>※ resetType이(가) "days" 이면 필수 |

**관련 메서드:**
describeLimitModels - 횟수 제한 모델 리스트 조회
getLimitModel - 횟수 제한 모델 가져오기



---

### CurrentLimitMaster

현재 활성화된 사용 횟수 제한 모델의 마스터 데이터<br>

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

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

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


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

**관련 메서드:**
exportMaster - 횟수 제한 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보내기
getCurrentLimitMaster - 현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터 조회
updateCurrentLimitMaster - 현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터 갱신
updateCurrentLimitMasterFromGitHub - 현재 활성화되어 있는 횟수 제한 모델 마스터를 GitHub에서 갱신



---

### LimitModelMaster

사용 횟수 제한 모델 마스터<br>

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

사용 횟수 제한에는 사용 횟수를 리셋하는 시점을 설정할 수 있습니다.<br>
리셋 간격은 「매일」「매주」「매월」「일정 일수」「리셋 안 함」의 5종류 중에서 선택할 수 있습니다.<br>
또한 여기서 지정하는 시각은 모두 협정 세계시(UTC)입니다.<br>

또한 사용 횟수 제한의 최대값은 마스터 데이터 쪽에서 고정하지 않습니다.<br>
이는 게임 내 상황에 따라 허용되는 최대 횟수를 동적으로 변경할 수 있도록 하기 위함입니다.<br>
예를 들어 스텝업 가챠처럼,<br>
- 구매 횟수 카운터가 3회 미만인 경우 구매할 수 있는 상품<br>
- 위 상품을 구매할 수 없는 경우, 구매 횟수 카운터가 5회 미만이면 구매할 수 있는 다른 상품<br>

이처럼 상황에 따라 「최대 횟수」를 전환할 수 있는 설계를 상정하고 있습니다.<br>

또한 이 사용 횟수 제한 모델에 연결된 카운터는 여러 개 만들 수 있습니다.<br>
예를 들어 「한 번만 받을 수 있는 퀘스트 보상」이 여러 개 있는 경우, 퀘스트마다 개별 사용 횟수 제한 모델을 만들 필요 없이 하나의 사용 횟수 제한 모델을 공유하고 퀘스트마다 카운터만 나누어 생성함으로써 설정 종류가 과도하게 늘어나는 것을 방지할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| limitModelId | string |  | ※ |  |  ~ 1024자 | 횟수 제한 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>사용 횟수 제한 모델 고유의 이름입니다. 영숫자 및 -(하이픈), _(밑줄), .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| resetType | 문자열 열거형<br>enum {<br>"notReset",<br>"daily",<br>"weekly",<br>"monthly",<br>"days"<br>}<br> |  | ✓ |  |  | 리셋 타이밍<br>이 횟수 제한 모델 하위의 카운터 값이 자동으로 0으로 리셋되는 타이밍을 결정합니다. notReset(영구적, 리셋 없음), daily(매일 지정된 시각에 리셋), weekly(지정된 요일에 리셋), monthly(지정된 날짜에 리셋), days(기준 일시로부터 일정 일수마다 리셋) 중에서 선택합니다. 모든 시각은 UTC입니다.notReset: 리셋 안 함 / daily: 매일 / weekly: 매주 / monthly: 매월 / days: 일정 일수마다 /  |
| resetDayOfMonth | int | {resetType} == "monthly" | ✓※ |  | 1 ~ 31 | 리셋 날짜<br>resetType이 "monthly"인 경우 카운터가 리셋되는 날짜(일)입니다. 1~31 사이의 값이 유효합니다. 지정한 날짜가 해당 월의 일수를 초과하는 경우(예: 2월의 31일), 해당 월의 마지막 날에 리셋됩니다.<br>※ resetType이(가) "monthly" 이면 필수 |
| resetDayOfWeek | 문자열 열거형<br>enum {<br>"sunday",<br>"monday",<br>"tuesday",<br>"wednesday",<br>"thursday",<br>"friday",<br>"saturday"<br>}<br> | {resetType} == "weekly" | ✓※ |  |  | 리셋 요일<br>resetType이 "weekly"인 경우 카운터가 리셋되는 요일입니다. 이 요일의 resetHour(UTC)로 지정된 시각에 리셋됩니다.sunday: 일요일 / monday: 월요일 / tuesday: 화요일 / wednesday: 수요일 / thursday: 목요일 / friday: 금요일 / saturday: 토요일 / <br>※ resetType이(가) "weekly" 이면 필수 |
| resetHour | int | {resetType} in ["monthly", "weekly", "daily"] | ✓※ |  | 0 ~ 23 | 리셋 시각<br>daily, weekly, monthly 리셋 타입에서 카운터가 리셋되는 UTC 시각(0~23)입니다. 예를 들어 값이 0이면 UTC 자정에 카운터가 리셋됩니다.<br>※ resetType이(가) "monthly","weekly","daily"이면 필수 |
| anchorTimestamp | long | {resetType} == "days" | ✓※ |  |  | 경과 일수를 계산하는 기준 일시<br>UNIX 시간(밀리초)<br>※ resetType이(가) "days" 이면 필수 |
| days | int | {resetType} == "days" | ✓※ |  | 1 ~ 2147483646 | 리셋 일수<br>resetType이 "days"인 경우 카운터 리셋 간격(일수)입니다. 리셋 주기는 anchorTimestamp를 기준으로 계산됩니다. 예를 들어 days가 7이고 anchorTimestamp가 월요일 정오라면, 매주 월요일 정오에 카운터가 리셋됩니다.<br>※ resetType이(가) "days" 이면 필수 |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeLimitModelMasters - 횟수 제한 모델 마스터 목록 조회
createLimitModelMaster - 횟수 제한 모델 마스터 신규 생성
getLimitModelMaster - 횟수 제한 모델 마스터 조회
updateLimitModelMaster - 횟수 제한 모델 마스터 갱신
deleteLimitModelMaster - 횟수 제한 모델 마스터 삭제



---
## 메서드

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

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

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

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

```



---

### createNamespace

네임스페이스 신규 생성<br>

네임스페이스의 이름, 설명 및 각종 설정을 포함한 상세 정보를 지정해야 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | 트랜잭션 설정<br>카운트업이나 카운터 리셋 등 사용 횟수 제한 조작 시 트랜잭션 처리 방식을 제어하는 설정입니다. |
| countUpScript | [ScriptSetting](#scriptsetting) |  | |  |  | 카운트업 시 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`countUp`](../script/#countup) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | 로그 출력 설정<br>사용 횟수 제한 조작의 API 요청·응답 로그를 출력하기 위한 GS2-Log 네임스페이스를 지정합니다. 디버그나 분석을 위해 카운터의 증가, 리셋, 제한 확인을 추적하는 데 유용합니다. |

#### Result

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

#### 구현 예제




**Go**
```go

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

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

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

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

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

```



---

### getNamespaceStatus

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

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


#### Request

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

#### Result

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

#### 구현 예제




**Go**
```go

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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

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

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

result = api_result.result
item = result.item;

```



---

### updateNamespace

네임스페이스 갱신<br>

지정된 네임스페이스의 설정을 갱신합니다.<br>
네임스페이스의 설명이나 특정 설정을 변경할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | 트랜잭션 설정<br>카운트업이나 카운터 리셋 등 사용 횟수 제한 조작 시 트랜잭션 처리 방식을 제어하는 설정입니다. |
| countUpScript | [ScriptSetting](#scriptsetting) |  | |  |  | 카운트업 시 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`countUp`](../script/#countup) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | 로그 출력 설정<br>사용 횟수 제한 조작의 API 요청·응답 로그를 출력하기 위한 GS2-Log 네임스페이스를 지정합니다. 디버그나 분석을 위해 카운터의 증가, 리셋, 제한 확인을 추적하는 데 유용합니다. |

#### Result

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

#### 구현 예제




**Go**
```go

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

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

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

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

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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;

```



---

### describeCounters

카운터 목록 조회<br>

요청한 사용자의 카운터 페이지네이션 목록을 조회합니다.<br>
횟수 제한 모델명으로 필터링하여 특정 모델의 카운터만 조회할 수 있습니다.<br>
각 카운터는 특정 액션이 실행된 횟수를 추적합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;Counter&gt;](#counter) | 카운터 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.DescribeCounters(
    &limit.DescribeCountersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        LimitName: pointy.String("daily"),
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeCountersRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->describeCounters(
        (new DescribeCountersRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withLimitName("daily")
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeCountersRequest;
import io.gs2.limit.result.DescribeCountersResult;

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

try {
    DescribeCountersResult result = client.describeCounters(
        new DescribeCountersRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withLimitName("daily")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Counter> 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.DescribeCountersResult> asyncResult = null;
yield return client.DescribeCounters(
    new Gs2.Gs2Limit.Request.DescribeCountersRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithLimitName("daily")
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.describeCounters(
        new Gs2Limit.DescribeCountersRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withLimitName("daily")
            .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 limit

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

try:
    result = client.describe_counters(
        limit.DescribeCountersRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_limit_name('daily')
            .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('limit')

api_result = client.describe_counters({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    limitName="daily",
    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('limit')

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

```



---

### describeCountersByUserId

사용자 ID를 지정하여 카운터 목록 조회<br>

지정된 사용자의 카운터 페이지네이션 목록을 조회합니다.<br>
횟수 제한 모델명으로 필터링할 수 있습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;Counter&gt;](#counter) | 카운터 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.DescribeCountersByUserId(
    &limit.DescribeCountersByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        LimitName: pointy.String("daily"),
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeCountersByUserIdRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->describeCountersByUserId(
        (new DescribeCountersByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withLimitName("daily")
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeCountersByUserIdRequest;
import io.gs2.limit.result.DescribeCountersByUserIdResult;

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

try {
    DescribeCountersByUserIdResult result = client.describeCountersByUserId(
        new DescribeCountersByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withLimitName("daily")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Counter> 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.DescribeCountersByUserIdResult> asyncResult = null;
yield return client.DescribeCountersByUserId(
    new Gs2.Gs2Limit.Request.DescribeCountersByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithLimitName("daily")
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.describeCountersByUserId(
        new Gs2Limit.DescribeCountersByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withLimitName("daily")
            .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 limit

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

try:
    result = client.describe_counters_by_user_id(
        limit.DescribeCountersByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_limit_name('daily')
            .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('limit')

api_result = client.describe_counters_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    limitName="daily",
    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('limit')

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

```



---

### getCounter

카운터 조회<br>

지정된 횟수 제한 모델과 카운터명에 대한 요청 사용자의 카운터를 조회합니다.<br>
현재 카운트 값을 반환합니다. 카운터가 존재하지 않는 경우 데이터는 반환되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.GetCounter(
    &limit.GetCounterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("daily"),
        AccessToken: pointy.String("accessToken-0001"),
        CounterName: pointy.String("counter1"),
    }
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetCounterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->getCounter(
        (new GetCounterRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("daily")
            ->withAccessToken("accessToken-0001")
            ->withCounterName("counter1")
    );
    $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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetCounterRequest;
import io.gs2.limit.result.GetCounterResult;

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

try {
    GetCounterResult result = client.getCounter(
        new GetCounterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter1")
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.GetCounterResult> asyncResult = null;
yield return client.GetCounter(
    new Gs2.Gs2Limit.Request.GetCounterRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("daily")
        .WithAccessToken("accessToken-0001")
        .WithCounterName("counter1"),
    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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.getCounter(
        new Gs2Limit.GetCounterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.get_counter(
        limit.GetCounterRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('daily')
            .with_access_token('accessToken-0001')
            .with_counter_name('counter1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.get_counter({
    namespaceName="namespace-0001",
    limitName="daily",
    accessToken="accessToken-0001",
    counterName="counter1",
})

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

api_result_handler = client.get_counter_async({
    namespaceName="namespace-0001",
    limitName="daily",
    accessToken="accessToken-0001",
    counterName="counter1",
})

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

```



---

### getCounterByUserId

사용자 ID를 지정하여 카운터 조회<br>

지정된 횟수 제한 모델과 카운터명에 대한 사용자의 카운터를 조회합니다.<br>
현재 카운트 값을 반환합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.GetCounterByUserId(
    &limit.GetCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("daily"),
        UserId: pointy.String("user-0001"),
        CounterName: pointy.String("counter2"),
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetCounterByUserIdRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->getCounterByUserId(
        (new GetCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("daily")
            ->withUserId("user-0001")
            ->withCounterName("counter2")
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetCounterByUserIdRequest;
import io.gs2.limit.result.GetCounterByUserIdResult;

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

try {
    GetCounterByUserIdResult result = client.getCounterByUserId(
        new GetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withUserId("user-0001")
            .withCounterName("counter2")
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.GetCounterByUserIdResult> asyncResult = null;
yield return client.GetCounterByUserId(
    new Gs2.Gs2Limit.Request.GetCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("daily")
        .WithUserId("user-0001")
        .WithCounterName("counter2")
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.getCounterByUserId(
        new Gs2Limit.GetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withUserId("user-0001")
            .withCounterName("counter2")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.get_counter_by_user_id(
        limit.GetCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('daily')
            .with_user_id('user-0001')
            .with_counter_name('counter2')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.get_counter_by_user_id({
    namespaceName="namespace-0001",
    limitName="daily",
    userId="user-0001",
    counterName="counter2",
    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('limit')

api_result_handler = client.get_counter_by_user_id_async({
    namespaceName="namespace-0001",
    limitName="daily",
    userId="user-0001",
    counterName="counter2",
    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;

```



---

### countUp

카운트업<br>

요청한 사용자의 카운터를 지정된 카운트업 값만큼 증가시킵니다.<br>
maxValue가 지정된 경우, 카운터는 해당 상한을 초과하지 않습니다. 작업이 최대값을 초과하는 경우 Overflow 오류가 반환됩니다.<br>
카운터가 아직 존재하지 않는 경우, 카운트 0으로 자동 생성된 후 증가합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| countUpValue | int |  | | 1 | 1 ~ 2147483646 | 카운트업할 양 |
| maxValue | int |  | |  | 1 ~ 2147483646 | 카운트업을 허용하는 최댓값 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 카운트를 증가시킨 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.CountUp(
    &limit.CountUpRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("daily"),
        CounterName: pointy.String("counter1"),
        AccessToken: pointy.String("accessToken-0001"),
        CountUpValue: pointy.Int32(1),
        MaxValue: pointy.Int32(100),
    }
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountUpRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->countUp(
        (new CountUpRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("daily")
            ->withCounterName("counter1")
            ->withAccessToken("accessToken-0001")
            ->withCountUpValue(1)
            ->withMaxValue(100)
    );
    $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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountUpRequest;
import io.gs2.limit.result.CountUpResult;

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

try {
    CountUpResult result = client.countUp(
        new CountUpRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withCounterName("counter1")
            .withAccessToken("accessToken-0001")
            .withCountUpValue(1)
            .withMaxValue(100)
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.CountUpResult> asyncResult = null;
yield return client.CountUp(
    new Gs2.Gs2Limit.Request.CountUpRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("daily")
        .WithCounterName("counter1")
        .WithAccessToken("accessToken-0001")
        .WithCountUpValue(1)
        .WithMaxValue(100),
    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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.countUp(
        new Gs2Limit.CountUpRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withCounterName("counter1")
            .withAccessToken("accessToken-0001")
            .withCountUpValue(1)
            .withMaxValue(100)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.count_up(
        limit.CountUpRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('daily')
            .with_counter_name('counter1')
            .with_access_token('accessToken-0001')
            .with_count_up_value(1)
            .with_max_value(100)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.count_up({
    namespaceName="namespace-0001",
    limitName="daily",
    counterName="counter1",
    accessToken="accessToken-0001",
    countUpValue=1,
    maxValue=100,
})

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

api_result_handler = client.count_up_async({
    namespaceName="namespace-0001",
    limitName="daily",
    counterName="counter1",
    accessToken="accessToken-0001",
    countUpValue=1,
    maxValue=100,
})

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

```



---

### countUpByUserId

사용자 ID를 지정하여 카운트업<br>

지정된 사용자의 카운터를 지정된 카운트업 값만큼 증가시킵니다.<br>
maxValue가 지정된 경우, 카운터는 해당 상한을 초과하지 않습니다. 작업이 최대값을 초과하는 경우 Overflow 오류가 반환됩니다.<br>
카운터가 아직 존재하지 않는 경우, 자동으로 생성됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| countUpValue | int |  | | 1 | 1 ~ 2147483646 | 카운트업할 양 |
| maxValue | int |  | |  | 1 ~ 2147483646 | 카운트업을 허용하는 최댓값 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 카운트를 증가시킨 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.CountUpByUserId(
    &limit.CountUpByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("daily"),
        CounterName: pointy.String("counter2"),
        UserId: pointy.String("user-0001"),
        CountUpValue: pointy.Int32(2),
        MaxValue: pointy.Int32(100),
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountUpByUserIdRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->countUpByUserId(
        (new CountUpByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("daily")
            ->withCounterName("counter2")
            ->withUserId("user-0001")
            ->withCountUpValue(2)
            ->withMaxValue(100)
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountUpByUserIdRequest;
import io.gs2.limit.result.CountUpByUserIdResult;

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

try {
    CountUpByUserIdResult result = client.countUpByUserId(
        new CountUpByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withUserId("user-0001")
            .withCountUpValue(2)
            .withMaxValue(100)
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.CountUpByUserIdResult> asyncResult = null;
yield return client.CountUpByUserId(
    new Gs2.Gs2Limit.Request.CountUpByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("daily")
        .WithCounterName("counter2")
        .WithUserId("user-0001")
        .WithCountUpValue(2)
        .WithMaxValue(100)
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.countUpByUserId(
        new Gs2Limit.CountUpByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withUserId("user-0001")
            .withCountUpValue(2)
            .withMaxValue(100)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.count_up_by_user_id(
        limit.CountUpByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('daily')
            .with_counter_name('counter2')
            .with_user_id('user-0001')
            .with_count_up_value(2)
            .with_max_value(100)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.count_up_by_user_id({
    namespaceName="namespace-0001",
    limitName="daily",
    counterName="counter2",
    userId="user-0001",
    countUpValue=2,
    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;

```

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

client = gs2('limit')

api_result_handler = client.count_up_by_user_id_async({
    namespaceName="namespace-0001",
    limitName="daily",
    counterName="counter2",
    userId="user-0001",
    countUpValue=2,
    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;

```



---

### countDownByUserId

사용자 ID를 지정하여 카운트다운<br>

지정된 사용자의 카운터를 지정된 카운트다운 값만큼 감소시킵니다.<br>
카운터 값은 0 미만으로 내려가지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| countDownValue | int |  | | 1 | 1 ~ 2147483646 | 카운트다운할 양 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 카운트를 감소시킨 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.CountDownByUserId(
    &limit.CountDownByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("daily"),
        CounterName: pointy.String("counter2"),
        UserId: pointy.String("user-0001"),
        CountDownValue: pointy.Int32(2),
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountDownByUserIdRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->countDownByUserId(
        (new CountDownByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("daily")
            ->withCounterName("counter2")
            ->withUserId("user-0001")
            ->withCountDownValue(2)
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountDownByUserIdRequest;
import io.gs2.limit.result.CountDownByUserIdResult;

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

try {
    CountDownByUserIdResult result = client.countDownByUserId(
        new CountDownByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withUserId("user-0001")
            .withCountDownValue(2)
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.CountDownByUserIdResult> asyncResult = null;
yield return client.CountDownByUserId(
    new Gs2.Gs2Limit.Request.CountDownByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("daily")
        .WithCounterName("counter2")
        .WithUserId("user-0001")
        .WithCountDownValue(2)
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.countDownByUserId(
        new Gs2Limit.CountDownByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withUserId("user-0001")
            .withCountDownValue(2)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.count_down_by_user_id(
        limit.CountDownByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('daily')
            .with_counter_name('counter2')
            .with_user_id('user-0001')
            .with_count_down_value(2)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.count_down_by_user_id({
    namespaceName="namespace-0001",
    limitName="daily",
    counterName="counter2",
    userId="user-0001",
    countDownValue=2,
    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('limit')

api_result_handler = client.count_down_by_user_id_async({
    namespaceName="namespace-0001",
    limitName="daily",
    counterName="counter2",
    userId="user-0001",
    countDownValue=2,
    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;

```



---

### deleteCounterByUserId

사용자 ID를 지정하여 카운터 삭제<br>

지정된 사용자의 카운터를 삭제하고 사용 횟수를 리셋합니다.<br>
이를 통해 이 카운터에 대한 횟수 제한이 실질적으로 해제되어, 사용자는 다시 0부터 카운트를 시작할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 삭제한 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.DeleteCounterByUserId(
    &limit.DeleteCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("daily"),
        UserId: pointy.String("user-0001"),
        CounterName: pointy.String("counter1"),
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DeleteCounterByUserIdRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->deleteCounterByUserId(
        (new DeleteCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("daily")
            ->withUserId("user-0001")
            ->withCounterName("counter1")
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DeleteCounterByUserIdRequest;
import io.gs2.limit.result.DeleteCounterByUserIdResult;

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

try {
    DeleteCounterByUserIdResult result = client.deleteCounterByUserId(
        new DeleteCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withUserId("user-0001")
            .withCounterName("counter1")
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.DeleteCounterByUserIdResult> asyncResult = null;
yield return client.DeleteCounterByUserId(
    new Gs2.Gs2Limit.Request.DeleteCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("daily")
        .WithUserId("user-0001")
        .WithCounterName("counter1")
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.deleteCounterByUserId(
        new Gs2Limit.DeleteCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("daily")
            .withUserId("user-0001")
            .withCounterName("counter1")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.delete_counter_by_user_id(
        limit.DeleteCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('daily')
            .with_user_id('user-0001')
            .with_counter_name('counter1')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.delete_counter_by_user_id({
    namespaceName="namespace-0001",
    limitName="daily",
    userId="user-0001",
    counterName="counter1",
    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('limit')

api_result_handler = client.delete_counter_by_user_id_async({
    namespaceName="namespace-0001",
    limitName="daily",
    userId="user-0001",
    counterName="counter1",
    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;

```



---

### verifyCounter

카운터 값 검증<br>

요청한 사용자의 카운터 값이 지정된 조건을 충족하는지 검증합니다.<br>
less, lessEqual, greater, greaterEqual, equal, notEqual의 6가지 비교 연산자를 지원합니다.<br>
조건이 충족되지 않는 경우, 오류가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 카운터 값이 지정 값 미만일 것 / lessEqual: 카운터 값이 지정 값 이하일 것 / greater: 카운터 값이 지정 값을 초과할 것 / greaterEqual: 카운터 값이 지정 값 이상일 것 / equal: 카운터 값이 지정 값과 일치할 것 / notEqual: 카운터 값이 지정 값과 일치하지 않을 것 /  |
| count | int |  | | 0 | 0 ~ 2147483646 | 카운트 값<br>이 카운터의 현재 사용 횟수입니다. countUp 조작으로 증가하며, 이때 지정된 최대값과 비교됩니다. 사용 횟수 제한 모델의 리셋 시점에 도달하면 자동으로 0으로 리셋됩니다. |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 삭제한 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.VerifyCounter(
    &limit.VerifyCounterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        LimitName: pointy.String("daily"),
        CounterName: pointy.String("counter2"),
        VerifyType: pointy.String("less"),
        Count: 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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\VerifyCounterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->verifyCounter(
        (new VerifyCounterRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withLimitName("daily")
            ->withCounterName("counter2")
            ->withVerifyType("less")
            ->withCount(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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.VerifyCounterRequest;
import io.gs2.limit.result.VerifyCounterResult;

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

try {
    VerifyCounterResult result = client.verifyCounter(
        new VerifyCounterRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.VerifyCounterResult> asyncResult = null;
yield return client.VerifyCounter(
    new Gs2.Gs2Limit.Request.VerifyCounterRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithLimitName("daily")
        .WithCounterName("counter2")
        .WithVerifyType("less")
        .WithCount(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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.verifyCounter(
        new Gs2Limit.VerifyCounterRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.verify_counter(
        limit.VerifyCounterRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_limit_name('daily')
            .with_counter_name('counter2')
            .with_verify_type('less')
            .with_count(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.verify_counter({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    limitName="daily",
    counterName="counter2",
    verifyType="less",
    count=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('limit')

api_result_handler = client.verify_counter_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    limitName="daily",
    counterName="counter2",
    verifyType="less",
    count=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;

```



---

### verifyCounterByUserId

사용자 ID를 지정하여 카운터 값 검증<br>

지정된 사용자의 카운터 값이 지정된 조건을 충족하는지 검증합니다.<br>
less, lessEqual, greater, greaterEqual, equal, notEqual의 6가지 비교 연산자를 지원합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>이 카운터가 속한 사용 횟수 제한 모델의 이름입니다. 이 카운터 값에 적용되는 리셋 일정(매일, 매주, 매월 등)을 결정합니다. |
| counterName | string |  | ✓|  |  ~ 128자 | 카운터 이름<br>사용 횟수 제한 모델 내에서 이 카운터를 고유하게 식별하는 이름입니다. 동일한 사용 횟수 제한 모델을 서로 다른 이름의 여러 카운터로 공유할 수 있어, 개별 사용 횟수 제한 모델을 만들지 않고도 별도의 사용 횟수 추적(예: 퀘스트별 또는 상품별로 카운터 1개)이 가능합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 카운터 값이 지정 값 미만일 것 / lessEqual: 카운터 값이 지정 값 이하일 것 / greater: 카운터 값이 지정 값을 초과할 것 / greaterEqual: 카운터 값이 지정 값 이상일 것 / equal: 카운터 값이 지정 값과 일치할 것 / notEqual: 카운터 값이 지정 값과 일치하지 않을 것 /  |
| count | int |  | | 0 | 0 ~ 2147483646 | 카운트 값<br>이 카운터의 현재 사용 횟수입니다. countUp 조작으로 증가하며, 이때 지정된 최대값과 비교됩니다. 사용 횟수 제한 모델의 리셋 시점에 도달하면 자동으로 0으로 리셋됩니다. |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Counter](#counter) | 삭제한 카운터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.VerifyCounterByUserId(
    &limit.VerifyCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        LimitName: pointy.String("daily"),
        CounterName: pointy.String("counter2"),
        VerifyType: pointy.String("less"),
        Count: 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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\VerifyCounterByUserIdRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->verifyCounterByUserId(
        (new VerifyCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withLimitName("daily")
            ->withCounterName("counter2")
            ->withVerifyType("less")
            ->withCount(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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.VerifyCounterByUserIdRequest;
import io.gs2.limit.result.VerifyCounterByUserIdResult;

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

try {
    VerifyCounterByUserIdResult result = client.verifyCounterByUserId(
        new VerifyCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.VerifyCounterByUserIdResult> asyncResult = null;
yield return client.VerifyCounterByUserId(
    new Gs2.Gs2Limit.Request.VerifyCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithLimitName("daily")
        .WithCounterName("counter2")
        .WithVerifyType("less")
        .WithCount(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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.verifyCounterByUserId(
        new Gs2Limit.VerifyCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withLimitName("daily")
            .withCounterName("counter2")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.verify_counter_by_user_id(
        limit.VerifyCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_limit_name('daily')
            .with_counter_name('counter2')
            .with_verify_type('less')
            .with_count(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('limit')

api_result = client.verify_counter_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    limitName="daily",
    counterName="counter2",
    verifyType="less",
    count=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('limit')

api_result_handler = client.verify_counter_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    limitName="daily",
    counterName="counter2",
    verifyType="less",
    count=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;

```



---

### describeLimitModels

횟수 제한 모델 리스트 조회<br>

현재 활성화된 횟수 제한 모델의 리스트를 가져옵니다.<br>
모델은 카운터의 리셋 타이밍(리셋 없음, 일별, 주별, 월별 등)과 관련 설정을 정의합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;LimitModel&gt;](#limitmodel) | 횟수 제한 모델의 리스트 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.DescribeLimitModels(
    &limit.DescribeLimitModelsRequest {
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeLimitModelsRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->describeLimitModels(
        (new DescribeLimitModelsRequest())
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeLimitModelsRequest;
import io.gs2.limit.result.DescribeLimitModelsResult;

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

try {
    DescribeLimitModelsResult result = client.describeLimitModels(
        new DescribeLimitModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<LimitModel> 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.DescribeLimitModelsResult> asyncResult = null;
yield return client.DescribeLimitModels(
    new Gs2.Gs2Limit.Request.DescribeLimitModelsRequest()
        .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 Gs2Limit from '@/gs2/limit';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.describe_limit_models(
        limit.DescribeLimitModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.describe_limit_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('limit')

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

```



---

### getLimitModel

횟수 제한 모델 가져오기<br>

지정된 횟수 제한 모델을 가져옵니다.<br>
모델은 이 제한과 관련된 카운터의 리셋 타입과 타이밍을 정의합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [LimitModel](#limitmodel) | 횟수 제한 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.GetLimitModel(
    &limit.GetLimitModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("limit-model-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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetLimitModelRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->getLimitModel(
        (new GetLimitModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("limit-model-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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetLimitModelRequest;
import io.gs2.limit.result.GetLimitModelResult;

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

try {
    GetLimitModelResult result = client.getLimitModel(
        new GetLimitModelRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
    );
    LimitModel 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.GetLimitModelResult> asyncResult = null;
yield return client.GetLimitModel(
    new Gs2.Gs2Limit.Request.GetLimitModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("limit-model-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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.getLimitModel(
        new Gs2Limit.GetLimitModelRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.get_limit_model(
        limit.GetLimitModelRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('limit-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.get_limit_model({
    namespaceName="namespace-0001",
    limitName="limit-model-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('limit')

api_result_handler = client.get_limit_model_async({
    namespaceName="namespace-0001",
    limitName="limit-model-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>

현재 활성화되어 있는 횟수 제한 모델 마스터를 활성화 가능한 형식으로 내보냅니다.<br>
내보낸 데이터는 다른 네임스페이스의 마스터 데이터 갱신이나 백업 용도로 사용할 수 있습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentLimitMaster](#currentlimitmaster) | 활성화 가능한 횟수 제한 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

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

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

$session->open();

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

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

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


```

**GS2-Script**
```lua

client = gs2('limit')

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

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;

```



---

### getCurrentLimitMaster

현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터 조회<br>

지정된 네임스페이스의 현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터를 조회합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentLimitMaster](#currentlimitmaster) | 현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.GetCurrentLimitMaster(
    &limit.GetCurrentLimitMasterRequest {
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetCurrentLimitMasterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->getCurrentLimitMaster(
        (new GetCurrentLimitMasterRequest())
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetCurrentLimitMasterRequest;
import io.gs2.limit.result.GetCurrentLimitMasterResult;

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

try {
    GetCurrentLimitMasterResult result = client.getCurrentLimitMaster(
        new GetCurrentLimitMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentLimitMaster 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.GetCurrentLimitMasterResult> asyncResult = null;
yield return client.GetCurrentLimitMaster(
    new Gs2.Gs2Limit.Request.GetCurrentLimitMasterRequest()
        .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 Gs2Limit from '@/gs2/limit';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.get_current_limit_master(
        limit.GetCurrentLimitMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.get_current_limit_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('limit')

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

```



---

### preUpdateCurrentLimitMaster

현재 활성화되어 있는 횟수 제한 모델 마스터를 갱신(3단계 버전)<br>

1MB를 초과하는 마스터 데이터를 업로드하는 경우, 3단계로 갱신을 수행합니다.<br>
1. 이 API를 실행하여 업로드용 토큰과 URL을 가져옵니다.<br>
2. 가져온 URL에 마스터 데이터를 업로드합니다.<br>
3. UpdateCurrentLimitMaster에 업로드로 얻은 토큰을 전달하여 실행하면 마스터 데이터가 반영됩니다.


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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentLimitMaster(
    &limit.PreUpdateCurrentLimitMasterRequest {
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\PreUpdateCurrentLimitMasterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentLimitMaster(
        (new PreUpdateCurrentLimitMasterRequest())
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.PreUpdateCurrentLimitMasterRequest;
import io.gs2.limit.result.PreUpdateCurrentLimitMasterResult;

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

try {
    PreUpdateCurrentLimitMasterResult result = client.preUpdateCurrentLimitMaster(
        new PreUpdateCurrentLimitMasterRequest()
            .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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.PreUpdateCurrentLimitMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentLimitMaster(
    new Gs2.Gs2Limit.Request.PreUpdateCurrentLimitMasterRequest()
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.preUpdateCurrentLimitMaster(
        new Gs2Limit.PreUpdateCurrentLimitMasterRequest()
            .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 limit

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

try:
    result = client.pre_update_current_limit_master(
        limit.PreUpdateCurrentLimitMasterRequest()
            .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('limit')

api_result = client.pre_update_current_limit_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('limit')

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

```



---

### updateCurrentLimitMaster

현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터 갱신<br>

현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터를 갱신합니다.<br>
인라인 설정용 'direct' 모드와, 3단계 갱신 프로세스에서 사전에 업로드한 설정을 적용하는 'preUpload' 모드, 이렇게 2가지 모드를 지원합니다.


#### 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 | [CurrentLimitMaster](#currentlimitmaster) | 갱신된 현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentLimitMaster(
    &limit.UpdateCurrentLimitMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2019-04-05\",\n  \"limitModels\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"resetType\": \"daily\",\n      \"resetHour\": 9\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"sunday\",\n      \"resetHour\": 18\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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\UpdateCurrentLimitMasterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->updateCurrentLimitMaster(
        (new UpdateCurrentLimitMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2019-04-05\",\n  \"limitModels\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"resetType\": \"daily\",\n      \"resetHour\": 9\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"sunday\",\n      \"resetHour\": 18\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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.UpdateCurrentLimitMasterRequest;
import io.gs2.limit.result.UpdateCurrentLimitMasterResult;

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

try {
    UpdateCurrentLimitMasterResult result = client.updateCurrentLimitMaster(
        new UpdateCurrentLimitMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-04-05\",\n  \"limitModels\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"resetType\": \"daily\",\n      \"resetHour\": 9\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"sunday\",\n      \"resetHour\": 18\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    CurrentLimitMaster 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.UpdateCurrentLimitMasterResult> asyncResult = null;
yield return client.UpdateCurrentLimitMaster(
    new Gs2.Gs2Limit.Request.UpdateCurrentLimitMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2019-04-05\",\n  \"limitModels\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"resetType\": \"daily\",\n      \"resetHour\": 9\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"sunday\",\n      \"resetHour\": 18\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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.updateCurrentLimitMaster(
        new Gs2Limit.UpdateCurrentLimitMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-04-05\",\n  \"limitModels\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"resetType\": \"daily\",\n      \"resetHour\": 9\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"sunday\",\n      \"resetHour\": 18\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.update_current_limit_master(
        limit.UpdateCurrentLimitMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2019-04-05",\n  "limitModels": [\n    {\n      "name": "daily",\n      "metadata": "DAILY",\n      "resetType": "daily",\n      "resetHour": 9\n    },\n    {\n      "name": "weekly",\n      "metadata": "WEEKLY",\n      "resetType": "weekly",\n      "resetDayOfWeek": "sunday",\n      "resetHour": 18\n    }\n  ]\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.update_current_limit_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-04-05\",\n  \"limitModels\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"resetType\": \"daily\",\n      \"resetHour\": 9\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"sunday\",\n      \"resetHour\": 18\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('limit')

api_result_handler = client.update_current_limit_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-04-05\",\n  \"limitModels\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"resetType\": \"daily\",\n      \"resetHour\": 9\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"sunday\",\n      \"resetHour\": 18\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;

```



---

### updateCurrentLimitMasterFromGitHub

현재 활성화되어 있는 횟수 제한 모델 마스터를 GitHub에서 갱신<br>

지정된 GitHub 리포지토리에서 마스터 데이터를 가져와 현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터를 갱신합니다.<br>
GS2-Key에 저장된 API 키가 인증에 사용되며, 체크아웃할 브랜치, 태그 또는 커밋 해시를 지정할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| checkoutSetting | [GitHubCheckoutSetting](#githubcheckoutsetting) |  | ✓|  |  | GitHub에서 마스터 데이터를 체크아웃하는 설정 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentLimitMaster](#currentlimitmaster) | 갱신된 현재 활성화되어 있는 횟수 제한 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentLimitMasterFromGitHub(
    &limit.UpdateCurrentLimitMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\UpdateCurrentLimitMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->updateCurrentLimitMasterFromGitHub(
        (new UpdateCurrentLimitMasterFromGitHubRequest())
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.UpdateCurrentLimitMasterFromGitHubRequest;
import io.gs2.limit.result.UpdateCurrentLimitMasterFromGitHubResult;

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

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

AsyncResult<Gs2.Gs2Limit.Result.UpdateCurrentLimitMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentLimitMasterFromGitHub(
    new Gs2.Gs2Limit.Request.UpdateCurrentLimitMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.updateCurrentLimitMasterFromGitHub(
        new Gs2Limit.UpdateCurrentLimitMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Limit.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 limit

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

try:
    result = client.update_current_limit_master_from_git_hub(
        limit.UpdateCurrentLimitMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(limit.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('limit')

api_result = client.update_current_limit_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('limit')

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

```



---

### describeLimitModelMasters

횟수 제한 모델 마스터 목록 조회<br>

횟수 제한 모델 마스터의 페이지네이션 목록을 조회합니다.<br>
이름의 접두사로 필터링할 수 있습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;LimitModelMaster&gt;](#limitmodelmaster) | 횟수 제한 모델 마스터의 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.DescribeLimitModelMasters(
    &limit.DescribeLimitModelMastersRequest {
        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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeLimitModelMastersRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->describeLimitModelMasters(
        (new DescribeLimitModelMastersRequest())
            ->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeLimitModelMastersRequest;
import io.gs2.limit.result.DescribeLimitModelMastersResult;

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

try {
    DescribeLimitModelMastersResult result = client.describeLimitModelMasters(
        new DescribeLimitModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<LimitModelMaster> 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.DescribeLimitModelMastersResult> asyncResult = null;
yield return client.DescribeLimitModelMasters(
    new Gs2.Gs2Limit.Request.DescribeLimitModelMastersRequest()
        .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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.describeLimitModelMasters(
        new Gs2Limit.DescribeLimitModelMastersRequest()
            .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 limit

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

try:
    result = client.describe_limit_model_masters(
        limit.DescribeLimitModelMastersRequest()
            .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('limit')

api_result = client.describe_limit_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('limit')

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

```



---

### createLimitModelMaster

횟수 제한 모델 마스터 신규 생성<br>

지정된 리셋 타이밍 설정으로 새로운 횟수 제한 모델 마스터를 생성합니다.<br>
리셋 타입은 notReset, daily, weekly, monthly, days 중에서 선택할 수 있으며, 정기 리셋을 위한 리셋 시각과 요일/날짜를 설정할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>사용 횟수 제한 모델 고유의 이름입니다. 영숫자 및 -(하이픈), _(밑줄), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| resetType | 문자열 열거형<br>enum {<br>"notReset",<br>"daily",<br>"weekly",<br>"monthly",<br>"days"<br>}<br> |  | ✓|  |  | 리셋 타이밍<br>이 횟수 제한 모델 하위의 카운터 값이 자동으로 0으로 리셋되는 타이밍을 결정합니다. notReset(영구적, 리셋 없음), daily(매일 지정된 시각에 리셋), weekly(지정된 요일에 리셋), monthly(지정된 날짜에 리셋), days(기준 일시로부터 일정 일수마다 리셋) 중에서 선택합니다. 모든 시각은 UTC입니다.notReset: 리셋 안 함 / daily: 매일 / weekly: 매주 / monthly: 매월 / days: 일정 일수마다 /  |
| resetDayOfMonth | int | {resetType} == "monthly" | ✓※|  | 1 ~ 31 | 리셋 날짜<br>resetType이 "monthly"인 경우 카운터가 리셋되는 날짜(일)입니다. 1~31 사이의 값이 유효합니다. 지정한 날짜가 해당 월의 일수를 초과하는 경우(예: 2월의 31일), 해당 월의 마지막 날에 리셋됩니다.<br>※ resetType이(가) "monthly" 이면 필수 |
| resetDayOfWeek | 문자열 열거형<br>enum {<br>"sunday",<br>"monday",<br>"tuesday",<br>"wednesday",<br>"thursday",<br>"friday",<br>"saturday"<br>}<br> | {resetType} == "weekly" | ✓※|  |  | 리셋 요일<br>resetType이 "weekly"인 경우 카운터가 리셋되는 요일입니다. 이 요일의 resetHour(UTC)로 지정된 시각에 리셋됩니다.sunday: 일요일 / monday: 월요일 / tuesday: 화요일 / wednesday: 수요일 / thursday: 목요일 / friday: 금요일 / saturday: 토요일 / <br>※ resetType이(가) "weekly" 이면 필수 |
| resetHour | int | {resetType} in ["monthly", "weekly", "daily"] | ✓※|  | 0 ~ 23 | 리셋 시각<br>daily, weekly, monthly 리셋 타입에서 카운터가 리셋되는 UTC 시각(0~23)입니다. 예를 들어 값이 0이면 UTC 자정에 카운터가 리셋됩니다.<br>※ resetType이(가) "monthly","weekly","daily"이면 필수 |
| anchorTimestamp | long | {resetType} == "days" | ✓※|  |  | 경과 일수를 계산하는 기준 일시<br>UNIX 시간(밀리초)<br>※ resetType이(가) "days" 이면 필수 |
| days | int | {resetType} == "days" | ✓※|  | 1 ~ 2147483646 | 리셋 일수<br>resetType이 "days"인 경우 카운터 리셋 간격(일수)입니다. 리셋 주기는 anchorTimestamp를 기준으로 계산됩니다. 예를 들어 days가 7이고 anchorTimestamp가 월요일 정오라면, 매주 월요일 정오에 카운터가 리셋됩니다.<br>※ resetType이(가) "days" 이면 필수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [LimitModelMaster](#limitmodelmaster) | 생성한 횟수 제한 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.CreateLimitModelMaster(
    &limit.CreateLimitModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("limit-model-0001"),
        Description: nil,
        Metadata: nil,
        ResetType: pointy.String("monthly"),
        ResetDayOfMonth: pointy.Int32(1),
        ResetDayOfWeek: pointy.String("monday"),
        ResetHour: pointy.Int32(5),
        AnchorTimestamp: pointy.Int64(1000),
        Days: pointy.Int32(10),
    }
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CreateLimitModelMasterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->createLimitModelMaster(
        (new CreateLimitModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("limit-model-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withResetType("monthly")
            ->withResetDayOfMonth(1)
            ->withResetDayOfWeek("monday")
            ->withResetHour(5)
            ->withAnchorTimestamp(1000)
            ->withDays(10)
    );
    $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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CreateLimitModelMasterRequest;
import io.gs2.limit.result.CreateLimitModelMasterResult;

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

try {
    CreateLimitModelMasterResult result = client.createLimitModelMaster(
        new CreateLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("limit-model-0001")
            .withDescription(null)
            .withMetadata(null)
            .withResetType("monthly")
            .withResetDayOfMonth(1)
            .withResetDayOfWeek("monday")
            .withResetHour(5)
            .withAnchorTimestamp(1000L)
            .withDays(10)
    );
    LimitModelMaster 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.CreateLimitModelMasterResult> asyncResult = null;
yield return client.CreateLimitModelMaster(
    new Gs2.Gs2Limit.Request.CreateLimitModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("limit-model-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithResetType("monthly")
        .WithResetDayOfMonth(1)
        .WithResetDayOfWeek("monday")
        .WithResetHour(5)
        .WithAnchorTimestamp(1000L)
        .WithDays(10),
    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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.createLimitModelMaster(
        new Gs2Limit.CreateLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("limit-model-0001")
            .withDescription(null)
            .withMetadata(null)
            .withResetType("monthly")
            .withResetDayOfMonth(1)
            .withResetDayOfWeek("monday")
            .withResetHour(5)
            .withAnchorTimestamp(1000)
            .withDays(10)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.create_limit_model_master(
        limit.CreateLimitModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('limit-model-0001')
            .with_description(None)
            .with_metadata(None)
            .with_reset_type('monthly')
            .with_reset_day_of_month(1)
            .with_reset_day_of_week('monday')
            .with_reset_hour(5)
            .with_anchor_timestamp(1000)
            .with_days(10)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.create_limit_model_master({
    namespaceName="namespace-0001",
    name="limit-model-0001",
    description=nil,
    metadata=nil,
    resetType="monthly",
    resetDayOfMonth=1,
    resetDayOfWeek="monday",
    resetHour=5,
    anchorTimestamp=1000,
    days=10,
})

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

api_result_handler = client.create_limit_model_master_async({
    namespaceName="namespace-0001",
    name="limit-model-0001",
    description=nil,
    metadata=nil,
    resetType="monthly",
    resetDayOfMonth=1,
    resetDayOfWeek="monday",
    resetHour=5,
    anchorTimestamp=1000,
    days=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;

```



---

### getLimitModelMaster

횟수 제한 모델 마스터 조회<br>

지정된 횟수 제한 모델 마스터를 조회합니다. 리셋 타입과 타이밍 설정을 포함합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [LimitModelMaster](#limitmodelmaster) | 횟수 제한 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.GetLimitModelMaster(
    &limit.GetLimitModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("limit-model-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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetLimitModelMasterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->getLimitModelMaster(
        (new GetLimitModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("limit-model-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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetLimitModelMasterRequest;
import io.gs2.limit.result.GetLimitModelMasterResult;

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

try {
    GetLimitModelMasterResult result = client.getLimitModelMaster(
        new GetLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
    );
    LimitModelMaster 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.GetLimitModelMasterResult> asyncResult = null;
yield return client.GetLimitModelMaster(
    new Gs2.Gs2Limit.Request.GetLimitModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("limit-model-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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.getLimitModelMaster(
        new Gs2Limit.GetLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.get_limit_model_master(
        limit.GetLimitModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('limit-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.get_limit_model_master({
    namespaceName="namespace-0001",
    limitName="limit-model-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('limit')

api_result_handler = client.get_limit_model_master_async({
    namespaceName="namespace-0001",
    limitName="limit-model-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;

```



---

### updateLimitModelMaster

횟수 제한 모델 마스터 갱신<br>

지정된 횟수 제한 모델 마스터를 갱신합니다. 설명, 메타데이터, 리셋 타이밍 설정을 변경할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| limitName | string |  | ✓|  |  ~ 128자 | 사용 횟수 제한 모델 이름<br>사용 횟수 제한 모델 고유의 이름입니다. 영숫자 및 -(하이픈), _(밑줄), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| resetType | 문자열 열거형<br>enum {<br>"notReset",<br>"daily",<br>"weekly",<br>"monthly",<br>"days"<br>}<br> |  | ✓|  |  | 리셋 타이밍<br>이 횟수 제한 모델 하위의 카운터 값이 자동으로 0으로 리셋되는 타이밍을 결정합니다. notReset(영구적, 리셋 없음), daily(매일 지정된 시각에 리셋), weekly(지정된 요일에 리셋), monthly(지정된 날짜에 리셋), days(기준 일시로부터 일정 일수마다 리셋) 중에서 선택합니다. 모든 시각은 UTC입니다.notReset: 리셋 안 함 / daily: 매일 / weekly: 매주 / monthly: 매월 / days: 일정 일수마다 /  |
| resetDayOfMonth | int | {resetType} == "monthly" | ✓※|  | 1 ~ 31 | 리셋 날짜<br>resetType이 "monthly"인 경우 카운터가 리셋되는 날짜(일)입니다. 1~31 사이의 값이 유효합니다. 지정한 날짜가 해당 월의 일수를 초과하는 경우(예: 2월의 31일), 해당 월의 마지막 날에 리셋됩니다.<br>※ resetType이(가) "monthly" 이면 필수 |
| resetDayOfWeek | 문자열 열거형<br>enum {<br>"sunday",<br>"monday",<br>"tuesday",<br>"wednesday",<br>"thursday",<br>"friday",<br>"saturday"<br>}<br> | {resetType} == "weekly" | ✓※|  |  | 리셋 요일<br>resetType이 "weekly"인 경우 카운터가 리셋되는 요일입니다. 이 요일의 resetHour(UTC)로 지정된 시각에 리셋됩니다.sunday: 일요일 / monday: 월요일 / tuesday: 화요일 / wednesday: 수요일 / thursday: 목요일 / friday: 금요일 / saturday: 토요일 / <br>※ resetType이(가) "weekly" 이면 필수 |
| resetHour | int | {resetType} in ["monthly", "weekly", "daily"] | ✓※|  | 0 ~ 23 | 리셋 시각<br>daily, weekly, monthly 리셋 타입에서 카운터가 리셋되는 UTC 시각(0~23)입니다. 예를 들어 값이 0이면 UTC 자정에 카운터가 리셋됩니다.<br>※ resetType이(가) "monthly","weekly","daily"이면 필수 |
| anchorTimestamp | long | {resetType} == "days" | ✓※|  |  | 경과 일수를 계산하는 기준 일시<br>UNIX 시간(밀리초)<br>※ resetType이(가) "days" 이면 필수 |
| days | int | {resetType} == "days" | ✓※|  | 1 ~ 2147483646 | 리셋 일수<br>resetType이 "days"인 경우 카운터 리셋 간격(일수)입니다. 리셋 주기는 anchorTimestamp를 기준으로 계산됩니다. 예를 들어 days가 7이고 anchorTimestamp가 월요일 정오라면, 매주 월요일 정오에 카운터가 리셋됩니다.<br>※ resetType이(가) "days" 이면 필수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [LimitModelMaster](#limitmodelmaster) | 갱신한 횟수 제한 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.UpdateLimitModelMaster(
    &limit.UpdateLimitModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("limit-model-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
        ResetType: pointy.String("daily"),
        ResetDayOfMonth: pointy.Int32(1),
        ResetDayOfWeek: pointy.String("monday"),
        ResetHour: pointy.Int32(18),
        AnchorTimestamp: pointy.Int64(2000),
        Days: pointy.Int32(5),
    }
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\UpdateLimitModelMasterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->updateLimitModelMaster(
        (new UpdateLimitModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("limit-model-0001")
            ->withDescription("description1")
            ->withMetadata("{\"hoge\": \"fuga\"}")
            ->withResetType("daily")
            ->withResetDayOfMonth(1)
            ->withResetDayOfWeek("monday")
            ->withResetHour(18)
            ->withAnchorTimestamp(2000)
            ->withDays(5)
    );
    $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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.UpdateLimitModelMasterRequest;
import io.gs2.limit.result.UpdateLimitModelMasterResult;

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

try {
    UpdateLimitModelMasterResult result = client.updateLimitModelMaster(
        new UpdateLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withResetType("daily")
            .withResetDayOfMonth(1)
            .withResetDayOfWeek("monday")
            .withResetHour(18)
            .withAnchorTimestamp(2000L)
            .withDays(5)
    );
    LimitModelMaster 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.UpdateLimitModelMasterResult> asyncResult = null;
yield return client.UpdateLimitModelMaster(
    new Gs2.Gs2Limit.Request.UpdateLimitModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("limit-model-0001")
        .WithDescription("description1")
        .WithMetadata("{\"hoge\": \"fuga\"}")
        .WithResetType("daily")
        .WithResetDayOfMonth(1)
        .WithResetDayOfWeek("monday")
        .WithResetHour(18)
        .WithAnchorTimestamp(2000L)
        .WithDays(5),
    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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.updateLimitModelMaster(
        new Gs2Limit.UpdateLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withResetType("daily")
            .withResetDayOfMonth(1)
            .withResetDayOfWeek("monday")
            .withResetHour(18)
            .withAnchorTimestamp(2000)
            .withDays(5)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.update_limit_model_master(
        limit.UpdateLimitModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('limit-model-0001')
            .with_description('description1')
            .with_metadata('{"hoge": "fuga"}')
            .with_reset_type('daily')
            .with_reset_day_of_month(1)
            .with_reset_day_of_week('monday')
            .with_reset_hour(18)
            .with_anchor_timestamp(2000)
            .with_days(5)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.update_limit_model_master({
    namespaceName="namespace-0001",
    limitName="limit-model-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    resetType="daily",
    resetDayOfMonth=1,
    resetDayOfWeek="monday",
    resetHour=18,
    anchorTimestamp=2000,
    days=5,
})

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

api_result_handler = client.update_limit_model_master_async({
    namespaceName="namespace-0001",
    limitName="limit-model-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    resetType="daily",
    resetDayOfMonth=1,
    resetDayOfWeek="monday",
    resetHour=18,
    anchorTimestamp=2000,
    days=5,
})

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

```



---

### deleteLimitModelMaster

횟수 제한 모델 마스터 삭제<br>

지정된 횟수 제한 모델 마스터를 삭제합니다.<br>
다음 마스터 데이터 갱신까지, 현재 활성화되어 있는 마스터 데이터에는 영향을 주지 않습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [LimitModelMaster](#limitmodelmaster) | 삭제한 횟수 제한 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := limit.Gs2LimitRestClient{
    Session: &session,
}
result, err := client.DeleteLimitModelMaster(
    &limit.DeleteLimitModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        LimitName: pointy.String("limit-model-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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DeleteLimitModelMasterRequest;

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

$session->open();

$client = new Gs2LimitRestClient(
    $session
);

try {
    $result = $client->deleteLimitModelMaster(
        (new DeleteLimitModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withLimitName("limit-model-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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DeleteLimitModelMasterRequest;
import io.gs2.limit.result.DeleteLimitModelMasterResult;

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

try {
    DeleteLimitModelMasterResult result = client.deleteLimitModelMaster(
        new DeleteLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
    );
    LimitModelMaster 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 Gs2LimitRestClient(session);

AsyncResult<Gs2.Gs2Limit.Result.DeleteLimitModelMasterResult> asyncResult = null;
yield return client.DeleteLimitModelMaster(
    new Gs2.Gs2Limit.Request.DeleteLimitModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithLimitName("limit-model-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 Gs2Limit from '@/gs2/limit';

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

try {
    const result = await client.deleteLimitModelMaster(
        new Gs2Limit.DeleteLimitModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withLimitName("limit-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import limit

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

try:
    result = client.delete_limit_model_master(
        limit.DeleteLimitModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_limit_name('limit-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('limit')

api_result = client.delete_limit_model_master({
    namespaceName="namespace-0001",
    limitName="limit-model-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('limit')

api_result_handler = client.delete_limit_model_master_async({
    namespaceName="namespace-0001",
    limitName="limit-model-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;

```



---



