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

# GS2-Version SDK API 레퍼런스

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



## 모델

### Namespace

네임스페이스<br>

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

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


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024자 | 네임스페이스 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  |  |  |  | 트랜잭션 설정<br>버전 체크 작업 시 트랜잭션 처리 방법을 제어하는 설정입니다. |
| assumeUserId | string |  | ✓ |  |  ~ 1024자 | 버전 체크를 통과한 경우 승격되는 GS2-Identifier 사용자 GRN<br>버전 체크가 통과했을 때 권한을 이어받는 GS2-Identifier 사용자입니다. 버전 검증이 성공한 후, 시스템이 사용자를 대신하여 인가된 작업(액세스 부여 등)을 수행할 수 있도록 합니다. |
| acceptVersionScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 버전을 승인했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`acceptVersion`](../script/#acceptversion) |
| checkVersionTriggerScriptId | string |  |  |  |  ~ 1024자 | 버전 체크 처리를 실행하는 GS2-Script 스크립트 GRN<br>Script 트리거 레퍼런스 - [`checkVersion`](../script/#checkversion) |
| 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" 이면 필수 |

**관련 메서드:**
updateCurrentVersionMasterFromGitHub - 현재 활성화된 버전 모델의 마스터 데이터를 GitHub에서 갱신



---

### AcceptVersion

승인한 버전<br>

앱 버전이나 에셋 버전처럼 데이터에 연결된 버전이 아니라<br>
동의한 이용약관의 버전처럼 사용자별로 버전 관리가 필요한 엔티티에서 사용합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| acceptVersionId | string |  | ※ |  |  ~ 1024자 | 승인한 버전 GRN<br>※ 서버가 자동으로 설정 |
| versionName | string |  | ✓ |  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| version | [Version](#version) |  | ✓ |  |  | 버전<br>사용자가 승인 또는 거부한 버전 번호입니다. "active" 스코프의 버전 모델에서 사용되는 경우, 버전 체크 시 모델의 현재 버전과 비교됩니다. |
| status | 문자열 열거형<br>enum {<br>"accept",<br>"reject"<br>}<br> |  |  | "accept" |  | 상태<br>이 버전에 대한 사용자의 승인 판단입니다. "accept"는 사용자가 버전을 승인했음(예: 이용약관 동의)을 의미하고, "reject"는 사용자가 명시적으로 거부했음을 의미합니다.accept: 승인됨 / reject: 거부됨 /  |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeAcceptVersions - 승인한 버전 목록 조회
describeAcceptVersionsByUserId - 사용자 ID를 지정하여 승인한 버전 목록 조회
accept - 현재 버전을 승인
acceptByUserId - 사용자 ID를 지정하여 현재 버전을 승인
reject - 현재 버전을 거부
rejectByUserId - 사용자 ID를 지정하여 현재 버전을 거부
getAcceptVersion - 승인한 버전 조회
getAcceptVersionByUserId - 사용자 ID를 지정하여 승인한 버전 조회
deleteAcceptVersion - 승인한 버전 삭제
deleteAcceptVersionByUserId - 사용자 ID를 지정하여 승인한 버전 삭제



---

### VersionModel

버전 모델<br>

버전 모델에는 로그인은 허용하지만 버전 업그레이드가 가능함을 알리는 경고 버전과, 로그인을 허용하지 않는 에러 버전을 설정할 수 있습니다.<br>

현재 버전을 클라이언트에 신고하도록 할 때, 서명 유무를 지정할 수 있습니다.<br>
서명 있음을 선택한 경우, 클라이언트는 허위 버전을 신고할 수 없게 됩니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| versionModelId | string |  | ※ |  |  ~ 1024자 | 버전 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 버전 모델 이름<br>버전 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| scope | 문자열 열거형<br>enum {<br>"passive",<br>"active"<br>}<br> |  | ✓ |  |  | 판정에 사용할 버전 값의 종류<br>버전 체크에 사용할 버전 값을 얻는 방법을 결정합니다. "passive"는 체크 시점에 클라이언트가 현재 버전을 신고하는 방식이며, "active"는 사용자가 과거에 명시적으로 승인한 버전(이용약관 동의 등)을 사용하는 방식입니다.passive: 클라이언트에서 전송 / active: 과거 명시적으로 승인한 버전 /  |
| type | 문자열 열거형<br>enum {<br>"simple",<br>"schedule"<br>}<br> |  |  | "simple" |  | 버전 체크 모드<br>버전 체크 방식을 선택합니다. "simple"은 고정된 경고·에러 버전 임계값을 사용하며, "schedule"은 GS2-Schedule의 이벤트를 이용하여 시기에 따라 다른 버전 임계값을 적용합니다.simple: 심플 / schedule: 시계열 전환 /  |
| currentVersion | [Version](#version) | {type} == "simple" and {scope} == "active" | ✓※ |  |  | 현재 버전<br>이 버전 모델의 최신 버전입니다. "simple" 모드의 "active" 스코프에서만 사용되며, 사용자가 버전 업데이트를 승인·확인할 때 현재 버전을 알립니다.<br>※ type이(가) "simple"이고 scope이(가) "active" 이면 필수 |
| warningVersion | [Version](#version) | {type} == "simple" | ✓※ |  |  | 버전 업그레이드를 촉구하는 버전<br>업그레이드 알림을 표시하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮은 경우에도 로그인은 허용되지만 사용자에게 업그레이드가 권장됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| errorVersion | [Version](#version) | {type} == "simple" | ✓※ |  |  | 버전 체크에서 에러로 판정되는 버전<br>로그인을 허용하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮으면 버전 체크가 에러로 판정되어 로그인이 차단됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| scheduleVersions | [List&lt;ScheduleVersion&gt;](#scheduleversion) | {type} == "schedule" |  |  | 0 ~ 10 items | 시계열로 전환되는 버전 체크 내용 목록<br>GS2-Schedule의 이벤트를 기준으로 서로 다른 시점에 유효해지는 버전 체크 설정 목록입니다. 업데이트를 필수로 만들기 전에 경고를 표시하는 등 단계적인 버전 강제가 가능해집니다.<br>※ type이(가) "schedule" 이면 활성화 |
| needSignature | bool | {scope} == "passive" | ✓※ |  |  | 판정할 버전 값에 서명 검증이 필요한지 여부<br>활성화하면 클라이언트는 버전 신고와 함께 암호 서명을 제공해야 합니다. 이를 통해 클라이언트가 버전 체크를 회피하기 위해 허위 버전을 신고하는 것을 방지합니다. 스코프가 "passive"인 경우에만 적용됩니다.<br>※ scope이(가) "passive" 이면 필수 |
| signatureKeyId | string | {needSignature} | ✓※ |  |  ~ 1024자 | 암호화 키 GRN<br>※ needSignature이(가) "true" 이면 필수 |
| approveRequirement | 문자열 열거형<br>enum {<br>"required",<br>"optional"<br>}<br> | {scope} == "active" |  | "required" |  | 승인 필요 여부<br>이 버전 모델에 대한 사용자 승인이 필수인지 임의인지를 제어합니다. "required"인 경우, 사용자가 현재 버전을 승인하지 않으면 버전 체크가 실패합니다. "optional"인 경우, 승인 상태와 관계없이 버전 체크가 통과합니다. 스코프가 "active"인 경우에만 적용됩니다.required: 승인 필요 / optional: 임의 승인 / <br>※ scope이(가) "active" 이면 활성화 |

**관련 메서드:**
describeVersionModels - 버전 모델 목록 조회
getVersionModel - 버전 모델 조회


**관련 모델:**
Status - 버전 상태



---

### Status

버전 상태<br>

버전 검증 결과를 나타냅니다. 체크에 사용된 버전 모델과, 클라이언트로부터 신고되었거나 사용자 승인으로부터 기록된 현재 버전을 포함합니다. 버전 체크 결과의 일부로 반환되어, 버전이 최신인지, 업그레이드 경고가 필요한지, 차단되는지를 클라이언트에 통지합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| versionModel | [VersionModel](#versionmodel) |  | ✓ |  |  | 버전 모델<br>이 버전 체크에 사용된 버전 모델 정의입니다. 체크 결과를 결정한 경고·오류 버전 임계값, 스코프, 기타 설정을 포함합니다. |
| currentVersion | [Version](#version) |  |  |  |  | 현재 버전<br>버전 체크 시 평가된 버전입니다. "passive" 스코프의 경우 클라이언트가 신고한 버전이고, "active" 스코프의 경우 사용자가 과거에 승인한 버전입니다. 버전 정보를 사용할 수 없는 경우 존재하지 않을 수 있습니다. |


---

### TargetVersion

검증할 버전<br>

버전 체크를 위해 클라이언트가 전송하는 버전 신고를 나타냅니다. 서명 없음 모드에서는 버전을 직접 지정합니다. 서명 있음 모드에서는 변조 방지를 위해 암호 서명과 함께 버전이 바디에 포함됩니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| versionName | string |  | ✓ |  |  ~ 128자 | 버전 모델 이름<br>버전 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| body | string |  |  |  |  ~ 1048576자 | 바디<br>버전 정보를 포함하는 서명된 페이로드입니다. 서명 검증이 활성화된 경우(needSignature가 true)에 사용됩니다. 바디에는 서명과 대조하여 검증할 수 있는 형식으로 버전 데이터가 포함됩니다. |
| signature | string |  |  |  |  ~ 256자 | 서명<br>바디 내용을 검증하기 위한 암호 서명입니다. 제공된 경우, 서버는 버전 모델에 설정된 GS2-Key 암호화 키를 사용하여 서명을 검증한 후 신고된 버전을 받아들입니다. |
| version | [Version](#version) | {signature} == "" | ✓※ |  |  | 버전<br>검증 대상 버전 번호입니다. 서명 검증이 필요하지 않은 경우(서명이 제공되지 않은 경우)에 사용됩니다. 서명이 제공된 경우, 버전은 서명된 바디에서 추출됩니다.<br>※ signature이(가) "" 이면 필수 |


---

### SignTargetVersion

서명 대상 버전<br>

버전 신고의 서명 대상으로 사용되는 데이터 구조입니다. 리전, 오너, 네임스페이스, 버전 모델 이름, 버전 번호를 포함합니다. 이 데이터를 GS2-Key 암호화 키로 서명함으로써, 클라이언트가 버전 체크를 위해 전송하는 변조 방지된 버전 신고를 생성합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| region | string |  | ✓ |  |  ~ 128자 | 리전 |
| namespaceName | string |  | ✓ |  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| versionName | string |  | ✓ |  |  ~ 128자 | 버전 모델 이름<br>버전 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| version | [Version](#version) |  | ✓ |  |  | 버전<br>서명된 페이로드에 포함되는 버전 번호입니다. 이 버전은 네임스페이스 및 버전 모델 컨텍스트와 함께 암호 서명되는 데이터를 구성합니다. |


---

### Version

버전<br>

3단계 계층(메이저, 마이너, 마이크로)으로 구성된 버전 번호를 나타냅니다. 버전 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다. 버전 체크의 경고·에러 임계값 정의에 사용됩니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| major | int |  | ✓ |  | 0 ~ 2147483646 | 메이저 버전<br>버전 비교에서 가장 우선순위가 높은 구성 요소입니다. 메이저 버전의 차이는 마이너 버전 및 마이크로 버전보다 우선합니다. |
| minor | int |  | ✓ |  | 0 ~ 2147483646 | 마이너 버전<br>버전 비교에서 두 번째로 우선순위가 높은 구성 요소입니다. 메이저 버전이 동일한 경우에만 비교됩니다. |
| micro | int |  | ✓ |  | 0 ~ 2147483646 | 마이크로 버전<br>버전 비교에서 가장 우선순위가 낮은 구성 요소입니다. 메이저 버전과 마이너 버전이 모두 동일한 경우에만 비교됩니다. |

**관련 메서드:**
accept - 현재 버전을 승인
acceptByUserId - 사용자 ID를 지정하여 현재 버전을 승인
reject - 현재 버전을 거부
rejectByUserId - 사용자 ID를 지정하여 현재 버전을 거부
createVersionModelMaster - 버전 모델 마스터 신규 작성
updateVersionModelMaster - 버전 모델 마스터 갱신


**관련 모델:**
AcceptVersion - 승인한 버전
VersionModel - 버전 모델
Status - 버전 상태
TargetVersion - 검증할 버전
SignTargetVersion - 서명 대상 버전
ScheduleVersion - 시계열로 전환되는 버전
VersionModelMaster - 버전 모델 마스터



---

### ScheduleVersion

시계열로 전환되는 버전<br>

GS2-Schedule의 이벤트로 제어되는 특정 기간 동안 유효해지는 버전 임계값(현재, 경고, 에러) 세트를 정의합니다. 여러 개의 스케줄 버전을 설정함으로써, 오래된 클라이언트를 차단하기 전에 사용자에게 경고하는 등 단계적인 버전 강제를 구현할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| currentVersion | [Version](#version) |  | ✓ |  |  | 현재 버전<br>이 스케줄 기간 동안 사용 가능한 최신 버전입니다. "active" 스코프에서 사용자가 업데이트를 승인할 때 현재 버전을 알리는 데 사용됩니다. |
| warningVersion | [Version](#version) |  | ✓ |  |  | 버전 업그레이드를 촉구하는 버전<br>이 스케줄 기간 동안 업그레이드 알림을 표시하는 최소 버전 임계값입니다. 로그인은 허용되지만 사용자에게 업그레이드가 권장됩니다. |
| errorVersion | [Version](#version) |  | ✓ |  |  | 버전 체크에서 에러로 판정되는 버전<br>이 스케줄 기간 동안 로그인을 허용하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮으면 버전 체크가 에러로 판정되어 로그인이 차단됩니다. |
| scheduleEventId | string |  |  |  |  ~ 1024자 | 버전 체크를 활성화하는 GS2-Schedule 이벤트 GRN<br>이 버전 임계값 세트가 유효해지는 기간을 제어하는 GS2-Schedule의 이벤트를 지정합니다. 여기서 정의된 버전 체크 설정은 지정한 이벤트가 활성화되어 있는 기간에만 적용됩니다. |

**관련 모델:**
VersionModel - 버전 모델
VersionModelMaster - 버전 모델 마스터



---

### CurrentVersionMaster

현재 활성화된 버전 모델의 마스터 데이터<br>

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

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

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


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

**관련 메서드:**
exportMaster - 버전 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보내기
getCurrentVersionMaster - 현재 활성화된 버전 모델의 마스터 데이터 조회
updateCurrentVersionMaster - 현재 활성화된 버전 모델의 마스터 데이터를 갱신
updateCurrentVersionMasterFromGitHub - 현재 활성화된 버전 모델의 마스터 데이터를 GitHub에서 갱신



---

### VersionModelMaster

버전 모델 마스터<br>

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

버전 모델에서는 로그인은 허용하지만 업그레이드가 가능하다는 것을 알리는 경고 버전과, 로그인을 허용하지 않는 오류 버전을 설정할 수 있습니다.<br>

현재 버전을 클라이언트에 신고하도록 하는 방식에 서명 유무를 지정할 수 있습니다.<br>
서명 있음을 선택한 경우, 클라이언트는 거짓 버전 신고를 할 수 없게 됩니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| versionModelId | string |  | ※ |  |  ~ 1024자 | 버전 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 버전 모델 이름<br>버전 모델 고유의 이름입니다. 영숫자 및 -(하이픈), _(밑줄), .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| scope | 문자열 열거형<br>enum {<br>"passive",<br>"active"<br>}<br> |  | ✓ |  |  | 판정에 사용할 버전 값의 종류<br>버전 체크에 사용할 버전 값을 얻는 방법을 결정합니다. "passive"는 체크 시점에 클라이언트가 현재 버전을 신고하는 방식이며, "active"는 사용자가 과거에 명시적으로 승인한 버전(이용약관 동의 등)을 사용하는 방식입니다.passive: 클라이언트에서 전송 / active: 과거 명시적으로 승인한 버전 /  |
| type | 문자열 열거형<br>enum {<br>"simple",<br>"schedule"<br>}<br> |  |  | "simple" |  | 버전 체크 모드<br>버전 체크 방식을 선택합니다. "simple"은 고정된 경고·에러 버전 임계값을 사용하며, "schedule"은 GS2-Schedule의 이벤트를 이용하여 시기에 따라 다른 버전 임계값을 적용합니다.simple: 심플 / schedule: 시계열 전환 /  |
| currentVersion | [Version](#version) | {type} == "simple" and {scope} == "active" | ✓※ |  |  | 현재 버전<br>이 버전 모델의 최신 버전입니다. "simple" 모드의 "active" 스코프에서만 사용되며, 사용자가 버전 업데이트를 승인·확인할 때 현재 버전을 알립니다.<br>※ type이(가) "simple"이고 scope이(가) "active" 이면 필수 |
| warningVersion | [Version](#version) | {type} == "simple" | ✓※ |  |  | 버전 업그레이드를 촉구하는 버전<br>업그레이드 알림을 표시하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮은 경우에도 로그인은 허용되지만 사용자에게 업그레이드가 권장됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| errorVersion | [Version](#version) | {type} == "simple" | ✓※ |  |  | 버전 체크에서 에러로 판정되는 버전<br>로그인을 허용하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮으면 버전 체크가 에러로 판정되어 로그인이 차단됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| scheduleVersions | [List&lt;ScheduleVersion&gt;](#scheduleversion) | {type} == "schedule" |  |  | 0 ~ 10 items | 시계열로 전환되는 버전 체크 내용 목록<br>GS2-Schedule의 이벤트를 기준으로 서로 다른 시점에 유효해지는 버전 체크 설정 목록입니다. 업데이트를 필수로 만들기 전에 경고를 표시하는 등 단계적인 버전 강제가 가능해집니다.<br>※ type이(가) "schedule" 이면 활성화 |
| needSignature | bool | {scope} == "passive" | ✓※ |  |  | 판정할 버전 값에 서명 검증이 필요한지 여부<br>활성화하면 클라이언트는 버전 신고와 함께 암호 서명을 제공해야 합니다. 이를 통해 클라이언트가 버전 체크를 회피하기 위해 허위 버전을 신고하는 것을 방지합니다. 스코프가 "passive"인 경우에만 적용됩니다.<br>※ scope이(가) "passive" 이면 필수 |
| signatureKeyId | string | {needSignature} | ✓※ |  |  ~ 1024자 | 암호화 키 GRN<br>※ needSignature이(가) "true" 이면 필수 |
| approveRequirement | 문자열 열거형<br>enum {<br>"required",<br>"optional"<br>}<br> | {scope} == "active" |  | "required" |  | 승인 필요 여부<br>이 버전 모델에 대한 사용자 승인이 필수인지 임의인지를 제어합니다. "required"인 경우, 사용자가 현재 버전을 승인하지 않으면 버전 체크가 실패합니다. "optional"인 경우, 승인 상태와 관계없이 버전 체크가 통과합니다. 스코프가 "active"인 경우에만 적용됩니다.required: 승인 필요 / optional: 임의 승인 / <br>※ scope이(가) "active" 이면 활성화 |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeVersionModelMasters - 버전 모델 마스터 목록 조회
createVersionModelMaster - 버전 모델 마스터 신규 작성
getVersionModelMaster - 버전 모델 마스터 조회
updateVersionModelMaster - 버전 모델 마스터 갱신
deleteVersionModelMaster - 버전 모델 마스터 삭제



---
## 메서드

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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>버전 체크 작업 시 트랜잭션 처리 방법을 제어하는 설정입니다. |
| assumeUserId | string |  | ✓|  |  ~ 1024자 | 버전 체크를 통과한 경우 승격되는 GS2-Identifier 사용자 GRN<br>버전 체크가 통과했을 때 권한을 이어받는 GS2-Identifier 사용자입니다. 버전 검증이 성공한 후, 시스템이 사용자를 대신하여 인가된 작업(액세스 부여 등)을 수행할 수 있도록 합니다. |
| acceptVersionScript | [ScriptSetting](#scriptsetting) |  | |  |  | 버전을 승인했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`acceptVersion`](../script/#acceptversion) |
| checkVersionTriggerScriptId | string |  | |  |  ~ 1024자 | 버전 체크 처리를 실행하는 GS2-Script 스크립트 GRN<br>Script 트리거 레퍼런스 - [`checkVersion`](../script/#checkversion) |
| 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/version"
import "github.com/openlyinc/pointy"

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &version.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0001"),
        AcceptVersionScript: nil,
        CheckVersionTriggerScriptId: nil,
        LogSetting: &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            ->withAcceptVersionScript(null)
            ->withCheckVersionTriggerScriptId(null)
            ->withLogSetting((new \Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CreateNamespaceRequest;
import io.gs2.version.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new io.gs2.version.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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Version.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
        .WithAcceptVersionScript(null)
        .WithCheckVersionTriggerScriptId(null)
        .WithLogSetting(new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.createNamespace(
        new Gs2Version.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new Gs2Version.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 version

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

try:
    result = client.create_namespace(
        version.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0001')
            .with_accept_version_script(None)
            .with_check_version_trigger_script_id(None)
            .with_log_setting(
                version.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('version')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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('version')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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/version"
import "github.com/openlyinc/pointy"

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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>버전 체크 작업 시 트랜잭션 처리 방법을 제어하는 설정입니다. |
| assumeUserId | string |  | ✓|  |  ~ 1024자 | 버전 체크를 통과한 경우 승격되는 GS2-Identifier 사용자 GRN<br>버전 체크가 통과했을 때 권한을 이어받는 GS2-Identifier 사용자입니다. 버전 검증이 성공한 후, 시스템이 사용자를 대신하여 인가된 작업(액세스 부여 등)을 수행할 수 있도록 합니다. |
| acceptVersionScript | [ScriptSetting](#scriptsetting) |  | |  |  | 버전을 승인했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`acceptVersion`](../script/#acceptversion) |
| checkVersionTriggerScriptId | string |  | |  |  ~ 1024자 | 버전 체크 처리를 실행하는 GS2-Script 스크립트 GRN<br>Script 트리거 레퍼런스 - [`checkVersion`](../script/#checkversion) |
| 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/version"
import "github.com/openlyinc/pointy"

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &version.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0002"),
        AcceptVersionScript: nil,
        CheckVersionTriggerScriptId: nil,
        LogSetting: &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            ->withAcceptVersionScript(null)
            ->withCheckVersionTriggerScriptId(null)
            ->withLogSetting((new \Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateNamespaceRequest;
import io.gs2.version.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new io.gs2.version.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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Version.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
        .WithAcceptVersionScript(null)
        .WithCheckVersionTriggerScriptId(null)
        .WithLogSetting(new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateNamespace(
        new Gs2Version.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new Gs2Version.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 version

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

try:
    result = client.update_namespace(
        version.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0002')
            .with_accept_version_script(None)
            .with_check_version_trigger_script_id(None)
            .with_log_setting(
                version.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('version')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0002",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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('version')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0002",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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/version"
import "github.com/openlyinc/pointy"

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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;

```



---

### describeAcceptVersions

승인한 버전 목록 조회<br>

요청한 사용자가 승인 또는 거부한 버전의 페이지네이션 목록을 조회합니다. 각 레코드에는 버전 모델 이름과 승인/거부된 버전 번호가 포함됩니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;AcceptVersion&gt;](#acceptversion) | 승인한 버전 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

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

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeAcceptVersionsRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

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

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeAcceptVersionsRequest;
import io.gs2.version.result.DescribeAcceptVersionsResult;

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

try {
    DescribeAcceptVersionsResult result = client.describeAcceptVersions(
        new DescribeAcceptVersionsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<AcceptVersion> 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 Gs2VersionRestClient(session);

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

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

```

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

client = gs2('version')

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

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

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

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

```



---

### describeAcceptVersionsByUserId

사용자 ID를 지정하여 승인한 버전 목록 조회<br>

지정한 사용자가 승인 또는 거부한 버전의 페이지네이션 목록을 조회합니다. 각 레코드에는 버전 모델 이름과 승인/거부된 버전 번호가 포함됩니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;AcceptVersion&gt;](#acceptversion) | 승인한 버전 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

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

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeAcceptVersionsByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

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

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeAcceptVersionsByUserIdRequest;
import io.gs2.version.result.DescribeAcceptVersionsByUserIdResult;

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

try {
    DescribeAcceptVersionsByUserIdResult result = client.describeAcceptVersionsByUserId(
        new DescribeAcceptVersionsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<AcceptVersion> 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 Gs2VersionRestClient(session);

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

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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

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

```

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

client = gs2('version')

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

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

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

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

```



---

### accept

현재 버전을 승인<br>

이용약관 등에서 이 기능을 사용하는 경우, 사용자가 이용약관을 확인하는 동안 서버의 현재 버전이 갱신되면 오류가 발생하므로<br>
version 인수에 동의하려는 버전을 지정해 주세요.<br>

버전을 지정하지 않으면 최신 버전으로 승인이 이루어진 것으로 간주되며, 인수로 버전을 지정한 경우 해당 버전이 오류 버전 조건을 만족하면 오류가 발생합니다.<br>
오류 버전 이외의 조건을 만족하더라도 API는 성공하며, 클라이언트가 지정한 버전으로 승인한 것으로 처리됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| version | [Version](#version) |  | |  |  | 승인한 버전 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 승인한 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.Accept(
    &version.AcceptRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("eula"),
        AccessToken: pointy.String("accessToken-0001"),
        Version: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
    }
)
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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\AcceptRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->accept(
        (new AcceptRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("eula")
            ->withAccessToken("accessToken-0001")
            ->withVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
    );
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.AcceptRequest;
import io.gs2.version.result.AcceptResult;

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

try {
    AcceptResult result = client.accept(
        new AcceptRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("eula")
            .withAccessToken("accessToken-0001")
            .withVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.AcceptResult> asyncResult = null;
yield return client.Accept(
    new Gs2.Gs2Version.Request.AcceptRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("eula")
        .WithAccessToken("accessToken-0001")
        .WithVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2)),
    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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.accept(
        new Gs2Version.AcceptRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("eula")
            .withAccessToken("accessToken-0001")
            .withVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.accept(
        version.AcceptRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('eula')
            .with_access_token('accessToken-0001')
            .with_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.accept({
    namespaceName="namespace-0001",
    versionName="eula",
    accessToken="accessToken-0001",
    version={
        major=2,
        minor=2,
        micro=2,
    },
})

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

api_result_handler = client.accept_async({
    namespaceName="namespace-0001",
    versionName="eula",
    accessToken="accessToken-0001",
    version={
        major=2,
        minor=2,
        micro=2,
    },
})

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

```



---

### acceptByUserId

사용자 ID를 지정하여 현재 버전을 승인<br>

이용약관 등에서 이 기능을 사용하는 경우, 사용자가 이용약관을 확인하는 동안 서버의 현재 버전이 갱신되면 오류가 발생하므로<br>
version 인수에 동의하려는 버전을 지정해 주세요.<br>

버전을 지정하지 않으면 최신 버전으로 승인이 이루어진 것으로 간주되며, 인수로 버전을 지정한 경우 해당 버전이 오류 버전 조건을 만족하면 오류가 발생합니다.<br>
오류 버전 이외의 조건을 만족하더라도 API는 성공하며, 클라이언트가 지정한 버전으로 승인한 것으로 처리됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| version | [Version](#version) |  | |  |  | 승인한 버전 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 승인한 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.AcceptByUserId(
    &version.AcceptByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        UserId: pointy.String("user-0001"),
        Version: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\AcceptByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->acceptByUserId(
        (new AcceptByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withUserId("user-0001")
            ->withVersion(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.AcceptByUserIdRequest;
import io.gs2.version.result.AcceptByUserIdResult;

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

try {
    AcceptByUserIdResult result = client.acceptByUserId(
        new AcceptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.AcceptByUserIdResult> asyncResult = null;
yield return client.AcceptByUserId(
    new Gs2.Gs2Version.Request.AcceptByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithUserId("user-0001")
        .WithVersion(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.acceptByUserId(
        new Gs2Version.AcceptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.accept_by_user_id(
        version.AcceptByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_user_id('user-0001')
            .with_version(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.accept_by_user_id({
    namespaceName="namespace-0001",
    versionName="version-0001",
    userId="user-0001",
    version=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('version')

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

```



---

### reject

현재 버전을 거부<br>

승인이 필수가 아닌 약관에서 거부되었음을 기록하기 위해 사용합니다.<br>
이 API를 호출하려면 VersionModel의 approveRequirement가 optional이어야 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| version | [Version](#version) |  | |  |  | 거부한 버전 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 거부한 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.Reject(
    &version.RejectRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Version: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\RejectRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->reject(
        (new RejectRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withAccessToken("accessToken-0001")
            ->withVersion(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.RejectRequest;
import io.gs2.version.result.RejectResult;

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

try {
    RejectResult result = client.reject(
        new RejectRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withAccessToken("accessToken-0001")
            .withVersion(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.RejectResult> asyncResult = null;
yield return client.Reject(
    new Gs2.Gs2Version.Request.RejectRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithAccessToken("accessToken-0001")
        .WithVersion(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.reject(
        new Gs2Version.RejectRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withAccessToken("accessToken-0001")
            .withVersion(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.reject(
        version.RejectRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_access_token('accessToken-0001')
            .with_version(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.reject({
    namespaceName="namespace-0001",
    versionName="version-0001",
    accessToken="accessToken-0001",
    version=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('version')

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

```



---

### rejectByUserId

사용자 ID를 지정하여 현재 버전을 거부<br>

승인이 필수가 아닌 약관에서 거부되었음을 기록하기 위해 사용합니다.<br>
이 API를 호출하려면 VersionModel의 approveRequirement가 optional이어야 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| version | [Version](#version) |  | |  |  | 거부한 버전 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 거부한 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.RejectByUserId(
    &version.RejectByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        UserId: pointy.String("user-0001"),
        Version: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\RejectByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->rejectByUserId(
        (new RejectByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withUserId("user-0001")
            ->withVersion(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.RejectByUserIdRequest;
import io.gs2.version.result.RejectByUserIdResult;

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

try {
    RejectByUserIdResult result = client.rejectByUserId(
        new RejectByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.RejectByUserIdResult> asyncResult = null;
yield return client.RejectByUserId(
    new Gs2.Gs2Version.Request.RejectByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithUserId("user-0001")
        .WithVersion(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.rejectByUserId(
        new Gs2Version.RejectByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.reject_by_user_id(
        version.RejectByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_user_id('user-0001')
            .with_version(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.reject_by_user_id({
    namespaceName="namespace-0001",
    versionName="version-0001",
    userId="user-0001",
    version=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('version')

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

```



---

### getAcceptVersion

승인한 버전 조회<br>

요청한 사용자와 지정된 버전 모델의 버전 승인 레코드를 조회합니다. 승인 또는 거부된 버전 번호가 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 승인한 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetAcceptVersion(
    &version.GetAcceptVersionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VersionName: pointy.String("eula"),
    }
)
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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetAcceptVersionRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getAcceptVersion(
        (new GetAcceptVersionRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withVersionName("eula")
    );
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetAcceptVersionRequest;
import io.gs2.version.result.GetAcceptVersionResult;

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

try {
    GetAcceptVersionResult result = client.getAcceptVersion(
        new GetAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetAcceptVersionResult> asyncResult = null;
yield return client.GetAcceptVersion(
    new Gs2.Gs2Version.Request.GetAcceptVersionRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithVersionName("eula"),
    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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getAcceptVersion(
        new Gs2Version.GetAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.get_accept_version(
        version.GetAcceptVersionRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_version_name('eula')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.get_accept_version({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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

api_result_handler = client.get_accept_version_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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

```



---

### getAcceptVersionByUserId

사용자 ID를 지정하여 승인한 버전 조회<br>

지정한 사용자와 버전 모델의 버전 승인 레코드를 조회합니다. 승인 또는 거부된 버전 번호가 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 승인한 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetAcceptVersionByUserId(
    &version.GetAcceptVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        VersionName: pointy.String("version-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetAcceptVersionByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getAcceptVersionByUserId(
        (new GetAcceptVersionByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withVersionName("version-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetAcceptVersionByUserIdRequest;
import io.gs2.version.result.GetAcceptVersionByUserIdResult;

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

try {
    GetAcceptVersionByUserIdResult result = client.getAcceptVersionByUserId(
        new GetAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetAcceptVersionByUserIdResult> asyncResult = null;
yield return client.GetAcceptVersionByUserId(
    new Gs2.Gs2Version.Request.GetAcceptVersionByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithVersionName("version-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getAcceptVersionByUserId(
        new Gs2Version.GetAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.get_accept_version_by_user_id(
        version.GetAcceptVersionByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_version_name('version-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.get_accept_version_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('version')

api_result_handler = client.get_accept_version_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### deleteAcceptVersion

승인한 버전 삭제<br>

요청한 사용자의 버전 승인 레코드를 삭제합니다. 삭제 후 버전 모델이 active 스코프를 사용하는 경우, 다음 버전 체크 시 사용자는 버전을 다시 승인해야 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 삭제한 승인 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteAcceptVersion(
    &version.DeleteAcceptVersionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VersionName: pointy.String("eula"),
    }
)
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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DeleteAcceptVersionRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->deleteAcceptVersion(
        (new DeleteAcceptVersionRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withVersionName("eula")
    );
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteAcceptVersionRequest;
import io.gs2.version.result.DeleteAcceptVersionResult;

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

try {
    DeleteAcceptVersionResult result = client.deleteAcceptVersion(
        new DeleteAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DeleteAcceptVersionResult> asyncResult = null;
yield return client.DeleteAcceptVersion(
    new Gs2.Gs2Version.Request.DeleteAcceptVersionRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithVersionName("eula"),
    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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.deleteAcceptVersion(
        new Gs2Version.DeleteAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.delete_accept_version(
        version.DeleteAcceptVersionRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_version_name('eula')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.delete_accept_version({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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

api_result_handler = client.delete_accept_version_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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

```



---

### deleteAcceptVersionByUserId

사용자 ID를 지정하여 승인한 버전 삭제<br>

지정한 사용자의 버전 승인 레코드를 삭제합니다. 삭제 후 버전 모델이 active 스코프를 사용하는 경우, 다음 버전 체크 시 사용자는 버전을 다시 승인해야 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 이름<br>이 승인 레코드가 연결되어 있는 버전 모델의 이름입니다. 사용자의 승인을 특정 버전 모델 정의에 연결합니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [AcceptVersion](#acceptversion) | 삭제한 승인 버전 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteAcceptVersionByUserId(
    &version.DeleteAcceptVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        VersionName: pointy.String("version-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DeleteAcceptVersionByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->deleteAcceptVersionByUserId(
        (new DeleteAcceptVersionByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withVersionName("version-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteAcceptVersionByUserIdRequest;
import io.gs2.version.result.DeleteAcceptVersionByUserIdResult;

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

try {
    DeleteAcceptVersionByUserIdResult result = client.deleteAcceptVersionByUserId(
        new DeleteAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DeleteAcceptVersionByUserIdResult> asyncResult = null;
yield return client.DeleteAcceptVersionByUserId(
    new Gs2.Gs2Version.Request.DeleteAcceptVersionByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithVersionName("version-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.deleteAcceptVersionByUserId(
        new Gs2Version.DeleteAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.delete_accept_version_by_user_id(
        version.DeleteAcceptVersionByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_version_name('version-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.delete_accept_version_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('version')

api_result_handler = client.delete_accept_version_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### checkVersion

버전 체크<br>

네임스페이스 내의 모든 버전 모델에 대해 클라이언트의 버전을 체크합니다. passive 스코프 모델에서는 targetVersions로 전달된 클라이언트 보고 버전이 사용됩니다(옵션으로 키 서비스를 통한 서명 검증 가능). active 스코프 모델에서는 사용자가 이전에 승인한 버전을 참조합니다. 버전 임계값을 기준으로 경고와 오류의 개별 목록을 반환합니다. 모든 체크가 오류 없이 통과되면, 네임스페이스에 설정된 사용자 ID를 사용하여 프로젝트 토큰이 발행됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| targetVersions | [List&lt;TargetVersion&gt;](#targetversion) |  | | [] | 0 ~ 1000 items | 검증할 버전 목록 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| projectToken | string | 로그인한 프로젝트 토큰 |
| warnings | [List&lt;Status&gt;](#status) | 버전 검증 결과 경고 목록 |
| errors | [List&lt;Status&gt;](#status) | 버전 검증 결과 오류 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckVersion(
    &version.CheckVersionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetVersions: []version.TargetVersion{
            version.TargetVersion{
                VersionName: pointy.String("app"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
            version.TargetVersion{
                VersionName: pointy.String("asset"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
projectToken := result.ProjectToken
warnings := result.Warnings
errors := result.Errors

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CheckVersionRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->checkVersion(
        (new CheckVersionRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetVersions([
                (new TargetVersion())
                    ->withVersionName("app")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
                (new TargetVersion())
                    ->withVersionName("asset")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
            ])
    );
    $projectToken = $result->getProjectToken();
    $warnings = $result->getWarnings();
    $errors = $result->getErrors();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CheckVersionRequest;
import io.gs2.version.result.CheckVersionResult;

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

try {
    CheckVersionResult result = client.checkVersion(
        new CheckVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withTargetVersions(Arrays.asList(
                new TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    )
            ))
    );
    String projectToken = result.getProjectToken();
    List<Status> warnings = result.getWarnings();
    List<Status> errors = result.getErrors();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Version.Result.CheckVersionResult> asyncResult = null;
yield return client.CheckVersion(
    new Gs2.Gs2Version.Request.CheckVersionRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetVersions(new Gs2.Gs2Version.Model.TargetVersion[] {
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("app")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("asset")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var projectToken = result.ProjectToken;
var warnings = result.Warnings;
var errors = result.Errors;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.checkVersion(
        new Gs2Version.CheckVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withTargetVersions([
                new Gs2Version.model.TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new Gs2Version.model.TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
            ])
    );
    const projectToken = result.getProjectToken();
    const warnings = result.getWarnings();
    const errors = result.getErrors();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.check_version(
        version.CheckVersionRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_target_versions([
                version.TargetVersion()
                    .with_version_name('app')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
                version.TargetVersion()
                    .with_version_name('asset')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
            ])
    )
    project_token = result.project_token
    warnings = result.warnings
    errors = result.errors
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.check_version({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
})

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

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

```

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

client = gs2('version')

api_result_handler = client.check_version_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
})

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

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

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

```



---

### checkVersionByUserId

사용자 ID를 지정하여 버전 체크<br>

네임스페이스 내의 모든 버전 모델에 대해 지정한 사용자의 버전을 체크합니다. passive 스코프 모델에서는 targetVersions로 전달된 클라이언트 보고 버전이 사용됩니다(옵션으로 서명 검증 가능). active 스코프 모델에서는 사용자가 이전에 승인한 버전을 참조합니다. 버전 임계값을 기준으로 경고와 오류의 개별 목록을 반환합니다. 모든 체크가 오류 없이 통과되면, 프로젝트 토큰이 발행됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| targetVersions | [List&lt;TargetVersion&gt;](#targetversion) |  | | [] | 0 ~ 1000 items | 검증할 버전 목록 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| projectToken | string | 로그인한 프로젝트 토큰 |
| warnings | [List&lt;Status&gt;](#status) | 버전 검증 결과 경고 목록 |
| errors | [List&lt;Status&gt;](#status) | 버전 검증 결과 오류 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckVersionByUserId(
    &version.CheckVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TargetVersions: []version.TargetVersion{
            version.TargetVersion{
                VersionName: pointy.String("app"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
            version.TargetVersion{
                VersionName: pointy.String("asset"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
projectToken := result.ProjectToken
warnings := result.Warnings
errors := result.Errors

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CheckVersionByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->checkVersionByUserId(
        (new CheckVersionByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTargetVersions([
                (new TargetVersion())
                    ->withVersionName("app")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
                (new TargetVersion())
                    ->withVersionName("asset")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
            ])
            ->withTimeOffsetToken(null)
    );
    $projectToken = $result->getProjectToken();
    $warnings = $result->getWarnings();
    $errors = $result->getErrors();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CheckVersionByUserIdRequest;
import io.gs2.version.result.CheckVersionByUserIdResult;

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

try {
    CheckVersionByUserIdResult result = client.checkVersionByUserId(
        new CheckVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTargetVersions(Arrays.asList(
                new TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    )
            ))
            .withTimeOffsetToken(null)
    );
    String projectToken = result.getProjectToken();
    List<Status> warnings = result.getWarnings();
    List<Status> errors = result.getErrors();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Version.Result.CheckVersionByUserIdResult> asyncResult = null;
yield return client.CheckVersionByUserId(
    new Gs2.Gs2Version.Request.CheckVersionByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTargetVersions(new Gs2.Gs2Version.Model.TargetVersion[] {
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("app")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("asset")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var projectToken = result.ProjectToken;
var warnings = result.Warnings;
var errors = result.Errors;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.checkVersionByUserId(
        new Gs2Version.CheckVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTargetVersions([
                new Gs2Version.model.TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new Gs2Version.model.TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
            ])
            .withTimeOffsetToken(null)
    );
    const projectToken = result.getProjectToken();
    const warnings = result.getWarnings();
    const errors = result.getErrors();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.check_version_by_user_id(
        version.CheckVersionByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_target_versions([
                version.TargetVersion()
                    .with_version_name('app')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
                version.TargetVersion()
                    .with_version_name('asset')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
            ])
            .with_time_offset_token(None)
    )
    project_token = result.project_token
    warnings = result.warnings
    errors = result.errors
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.check_version_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
    timeOffsetToken=nil,
})

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

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

```

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

client = gs2('version')

api_result_handler = client.check_version_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
    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
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

```



---

### calculateSignature

버전 서명 계산<br>

키 서비스를 사용하여 지정된 버전의 암호 서명을 계산합니다. 리전, 오너, 네임스페이스 컨텍스트와 함께 버전 정보가 본문(body)으로 직렬화되고, 버전 모델에 설정된 서명 키로 서명됩니다. 결과로 생성된 본문과 서명은 passive 스코프 모델에서 서명 검증이 포함된 버전 체크에 사용할 수 있습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| body | string | 본문 |
| signature | string | 서명 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CalculateSignature(
    &version.CalculateSignatureRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        Version: &version.Version{
            Major: pointy.Int32(1),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(3),
        },
    }
)
if err != nil {
    panic("error occurred")
}
body := result.Body
signature := result.Signature

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CalculateSignatureRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->calculateSignature(
        (new CalculateSignatureRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withVersion((new Version())
                ->withMajor(1)
                ->withMinor(2)
                ->withMicro(3)
            )
    );
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CalculateSignatureRequest;
import io.gs2.version.result.CalculateSignatureResult;

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

try {
    CalculateSignatureResult result = client.calculateSignature(
        new CalculateSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withVersion(new Version()
                .withMajor(1)
                .withMinor(2)
                .withMicro(3)
            )
    );
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Version.Result.CalculateSignatureResult> asyncResult = null;
yield return client.CalculateSignature(
    new Gs2.Gs2Version.Request.CalculateSignatureRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(1)
            .WithMinor(2)
            .WithMicro(3)
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.calculateSignature(
        new Gs2Version.CalculateSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(2)
                .withMicro(3)
            )
    );
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.calculate_signature(
        version.CalculateSignatureRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_version(version.Version()
                .with_major(1)
                .with_minor(2)
                .with_micro(3)
            )
    )
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.calculate_signature({
    namespaceName="namespace-0001",
    versionName="version-0001",
    version={
        major=1,
        minor=2,
        micro=3,
    },
})

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

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

```

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

client = gs2('version')

api_result_handler = client.calculate_signature_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
    version={
        major=1,
        minor=2,
        micro=3,
    },
})

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

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

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

```



---

### describeVersionModels

버전 모델 목록 조회<br>

현재 활성화된 버전 모델의 목록을 조회합니다. 각 모델에는 스코프(passive/active), 경고/오류 버전 임계값, 일정 기반 버전 제어, 서명 검증 설정을 포함한 버전 체크 규칙이 정의되어 있습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;VersionModel&gt;](#versionmodel) | 버전 모델 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeVersionModels(
    &version.DescribeVersionModelsRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeVersionModelsRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->describeVersionModels(
        (new DescribeVersionModelsRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeVersionModelsRequest;
import io.gs2.version.result.DescribeVersionModelsResult;

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

try {
    DescribeVersionModelsResult result = client.describeVersionModels(
        new DescribeVersionModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<VersionModel> 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeVersionModelsResult> asyncResult = null;
yield return client.DescribeVersionModels(
    new Gs2.Gs2Version.Request.DescribeVersionModelsRequest()
        .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 Gs2Version from '@/gs2/version';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.describe_version_models(
        version.DescribeVersionModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.describe_version_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('version')

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

```



---

### getVersionModel

버전 모델 조회<br>

스코프, 경고/오류 버전 임계값, 일정 기반 버전 규칙, 서명 요건, 승인 설정을 포함한 지정된 버전 모델을 조회합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [VersionModel](#versionmodel) | 버전 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetVersionModel(
    &version.GetVersionModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetVersionModelRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getVersionModel(
        (new GetVersionModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetVersionModelRequest;
import io.gs2.version.result.GetVersionModelResult;

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

try {
    GetVersionModelResult result = client.getVersionModel(
        new GetVersionModelRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    VersionModel 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetVersionModelResult> asyncResult = null;
yield return client.GetVersionModel(
    new Gs2.Gs2Version.Request.GetVersionModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getVersionModel(
        new Gs2Version.GetVersionModelRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.get_version_model(
        version.GetVersionModelRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.get_version_model({
    namespaceName="namespace-0001",
    versionName="version-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('version')

api_result_handler = client.get_version_model_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
})

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

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

result = api_result.result
item = result.item;

```



---

### exportMaster

버전 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보내기<br>

현재 등록되어 있는 버전 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보냅니다. 내보낸 데이터에는 범위, 버전 임계값, 스케줄 규칙, 서명 설정, 승인 요건을 포함한 모든 버전 모델 정의가 포함됩니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentVersionMaster](#currentversionmaster) | 활성화 가능한 버전 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

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

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

$session->open();

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

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

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


```

**GS2-Script**
```lua

client = gs2('version')

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

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;

```



---

### getCurrentVersionMaster

현재 활성화된 버전 모델의 마스터 데이터 조회<br>

버전 체크에 사용되고 있는, 모든 버전 모델 정의를 포함한 현재 활성화된 버전 모델 마스터 데이터를 조회합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentVersionMaster](#currentversionmaster) | 현재 활성화된 버전 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetCurrentVersionMaster(
    &version.GetCurrentVersionMasterRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetCurrentVersionMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getCurrentVersionMaster(
        (new GetCurrentVersionMasterRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetCurrentVersionMasterRequest;
import io.gs2.version.result.GetCurrentVersionMasterResult;

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

try {
    GetCurrentVersionMasterResult result = client.getCurrentVersionMaster(
        new GetCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentVersionMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetCurrentVersionMasterResult> asyncResult = null;
yield return client.GetCurrentVersionMaster(
    new Gs2.Gs2Version.Request.GetCurrentVersionMasterRequest()
        .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 Gs2Version from '@/gs2/version';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.get_current_version_master(
        version.GetCurrentVersionMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.get_current_version_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('version')

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

```



---

### preUpdateCurrentVersionMaster

현재 활성화된 버전 모델의 마스터 데이터 갱신(3단계 버전)<br>

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


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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentVersionMaster(
    &version.PreUpdateCurrentVersionMasterRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\PreUpdateCurrentVersionMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentVersionMaster(
        (new PreUpdateCurrentVersionMasterRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.PreUpdateCurrentVersionMasterRequest;
import io.gs2.version.result.PreUpdateCurrentVersionMasterResult;

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

try {
    PreUpdateCurrentVersionMasterResult result = client.preUpdateCurrentVersionMaster(
        new PreUpdateCurrentVersionMasterRequest()
            .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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.PreUpdateCurrentVersionMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentVersionMaster(
    new Gs2.Gs2Version.Request.PreUpdateCurrentVersionMasterRequest()
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.preUpdateCurrentVersionMaster(
        new Gs2Version.PreUpdateCurrentVersionMasterRequest()
            .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 version

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

try:
    result = client.pre_update_current_version_master(
        version.PreUpdateCurrentVersionMasterRequest()
            .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('version')

api_result = client.pre_update_current_version_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('version')

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

```



---

### updateCurrentVersionMaster

현재 활성화된 버전 모델의 마스터 데이터를 갱신<br>

현재 활성화된 버전 모델 마스터 데이터를 갱신합니다. 대용량 마스터 데이터에 대응하기 위해 직접 갱신 모드와 사전 업로드 모드를 모두 지원합니다. 사전 업로드 모드에서는 PreUpdate API로 취득한 업로드 토큰을 사용하여 설정을 읽어들입니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| mode | 문자열 열거형<br>enum {<br>"direct",<br>"preUpload"<br>}<br> |  | | "direct" |  | 업데이트 모드direct: 마스터 데이터를 직접 업데이트 / preUpload: 마스터 데이터를 업로드한 후 업데이트 /  |
| settings | string | {mode} == "direct" | ✓※|  |  ~ 5242880 바이트 (5MB) | 마스터 데이터<br>※ mode이(가) "direct" 이면 필수 |
| uploadToken | string | {mode} == "preUpload" | ✓※|  |  ~ 1024자 | 사전 업로드로 획득한 토큰<br>업로드한 마스터 데이터를 적용하기 위해 사용됩니다.<br>※ mode이(가) "preUpload" 이면 필수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentVersionMaster](#currentversionmaster) | 갱신된 현재 활성화된 버전 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentVersionMaster(
    &version.UpdateCurrentVersionMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateCurrentVersionMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateCurrentVersionMaster(
        (new UpdateCurrentVersionMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
            ->withUploadToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateCurrentVersionMasterRequest;
import io.gs2.version.result.UpdateCurrentVersionMasterResult;

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

try {
    UpdateCurrentVersionMasterResult result = client.updateCurrentVersionMaster(
        new UpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    CurrentVersionMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateCurrentVersionMasterResult> asyncResult = null;
yield return client.UpdateCurrentVersionMaster(
    new Gs2.Gs2Version.Request.UpdateCurrentVersionMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
        .WithUploadToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateCurrentVersionMaster(
        new Gs2Version.UpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.update_current_version_master(
        version.UpdateCurrentVersionMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2019-10-09",\n  "versionModels": [\n    {\n      "name": "app",\n      "metadata": "APP",\n      "warningVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "errorVersion": {\n        "major": 1,\n        "minor": 1,\n        "micro": 1\n      },\n      "scope": "passive",\n      "type": "simple",\n      "needSignature": false\n    },\n    {\n      "name": "asset",\n      "metadata": "ASSET",\n      "warningVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "errorVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "scope": "passive",\n      "type": "simple",\n      "needSignature": true,\n      "signatureKeyId": "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001"\n    },\n    {\n      "name": "eula",\n      "metadata": "EULA",\n      "type": "simple",\n      "warningVersion": {\n        "major": 4,\n        "minor": 4,\n        "micro": 4\n      },\n      "errorVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "scope": "active",\n      "type": "simple",\n      "currentVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      }\n    }\n  ]\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.update_current_version_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}",
    uploadToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('version')

api_result_handler = client.update_current_version_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}",
    uploadToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### updateCurrentVersionMasterFromGitHub

현재 활성화된 버전 모델의 마스터 데이터를 GitHub에서 갱신<br>

지정된 체크아웃 설정을 사용하여 GitHub 저장소에서 마스터 데이터를 체크아웃하고, 현재 활성화된 버전 모델 마스터 데이터를 갱신합니다. GitHub와의 인증에는 키 서비스를 통해 API 키가 복호화되어 사용됩니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentVersionMaster](#currentversionmaster) | 갱신된 현재 활성화된 버전 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentVersionMasterFromGitHub(
    &version.UpdateCurrentVersionMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateCurrentVersionMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateCurrentVersionMasterFromGitHub(
        (new UpdateCurrentVersionMasterFromGitHubRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateCurrentVersionMasterFromGitHubRequest;
import io.gs2.version.result.UpdateCurrentVersionMasterFromGitHubResult;

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

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

AsyncResult<Gs2.Gs2Version.Result.UpdateCurrentVersionMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentVersionMasterFromGitHub(
    new Gs2.Gs2Version.Request.UpdateCurrentVersionMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateCurrentVersionMasterFromGitHub(
        new Gs2Version.UpdateCurrentVersionMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Version.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 version

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

try:
    result = client.update_current_version_master_from_git_hub(
        version.UpdateCurrentVersionMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(version.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('version')

api_result = client.update_current_version_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('version')

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

```



---

### describeVersionModelMasters

버전 모델 마스터 목록 조회<br>

버전 모델 마스터의 페이지네이션 목록을 조회합니다. 이름 접두사로 필터링할 수 있습니다. 각 마스터에는 스코프(passive/active), 경고/오류 버전 임계값, 일정 기반 버전 제어, 서명 검증 설정, 승인 요건을 포함한 버전 체크 규칙이 정의되어 있습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;VersionModelMaster&gt;](#versionmodelmaster) | 버전 모델 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeVersionModelMasters(
    &version.DescribeVersionModelMastersRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeVersionModelMastersRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->describeVersionModelMasters(
        (new DescribeVersionModelMastersRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeVersionModelMastersRequest;
import io.gs2.version.result.DescribeVersionModelMastersResult;

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

try {
    DescribeVersionModelMastersResult result = client.describeVersionModelMasters(
        new DescribeVersionModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<VersionModelMaster> 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeVersionModelMastersResult> asyncResult = null;
yield return client.DescribeVersionModelMasters(
    new Gs2.Gs2Version.Request.DescribeVersionModelMastersRequest()
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeVersionModelMasters(
        new Gs2Version.DescribeVersionModelMastersRequest()
            .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 version

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

try:
    result = client.describe_version_model_masters(
        version.DescribeVersionModelMastersRequest()
            .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('version')

api_result = client.describe_version_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('version')

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

```



---

### createVersionModelMaster

버전 모델 마스터 신규 작성<br>

스코프(passive: 클라이언트 보고 버전, active: 서버 관리 승인), 현재/경고/오류 버전 임계값, 옵션인 일정 기반 버전 규칙, 서명 검증 설정, 승인 요건(required/optional)을 가진 새로운 버전 모델 마스터를 작성합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 버전 모델 이름<br>버전 모델 고유의 이름입니다. 영숫자 및 -(하이픈), _(밑줄), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| scope | 문자열 열거형<br>enum {<br>"passive",<br>"active"<br>}<br> |  | ✓|  |  | 판정에 사용할 버전 값의 종류<br>버전 체크에 사용할 버전 값을 얻는 방법을 결정합니다. "passive"는 체크 시점에 클라이언트가 현재 버전을 신고하는 방식이며, "active"는 사용자가 과거에 명시적으로 승인한 버전(이용약관 동의 등)을 사용하는 방식입니다.passive: 클라이언트에서 전송 / active: 과거 명시적으로 승인한 버전 /  |
| type | 문자열 열거형<br>enum {<br>"simple",<br>"schedule"<br>}<br> |  | | "simple" |  | 버전 체크 모드<br>버전 체크 방식을 선택합니다. "simple"은 고정된 경고·에러 버전 임계값을 사용하며, "schedule"은 GS2-Schedule의 이벤트를 이용하여 시기에 따라 다른 버전 임계값을 적용합니다.simple: 심플 / schedule: 시계열 전환 /  |
| currentVersion | [Version](#version) | {type} == "simple" and {scope} == "active" | ✓※|  |  | 현재 버전<br>이 버전 모델의 최신 버전입니다. "simple" 모드의 "active" 스코프에서만 사용되며, 사용자가 버전 업데이트를 승인·확인할 때 현재 버전을 알립니다.<br>※ type이(가) "simple"이고 scope이(가) "active" 이면 필수 |
| warningVersion | [Version](#version) | {type} == "simple" | ✓※|  |  | 버전 업그레이드를 촉구하는 버전<br>업그레이드 알림을 표시하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮은 경우에도 로그인은 허용되지만 사용자에게 업그레이드가 권장됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| errorVersion | [Version](#version) | {type} == "simple" | ✓※|  |  | 버전 체크에서 에러로 판정되는 버전<br>로그인을 허용하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮으면 버전 체크가 에러로 판정되어 로그인이 차단됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| scheduleVersions | [List&lt;ScheduleVersion&gt;](#scheduleversion) | {type} == "schedule" | |  | 0 ~ 10 items | 시계열로 전환되는 버전 체크 내용 목록<br>GS2-Schedule의 이벤트를 기준으로 서로 다른 시점에 유효해지는 버전 체크 설정 목록입니다. 업데이트를 필수로 만들기 전에 경고를 표시하는 등 단계적인 버전 강제가 가능해집니다.<br>※ type이(가) "schedule" 이면 활성화 |
| needSignature | bool | {scope} == "passive" | ✓※|  |  | 판정할 버전 값에 서명 검증이 필요한지 여부<br>활성화하면 클라이언트는 버전 신고와 함께 암호 서명을 제공해야 합니다. 이를 통해 클라이언트가 버전 체크를 회피하기 위해 허위 버전을 신고하는 것을 방지합니다. 스코프가 "passive"인 경우에만 적용됩니다.<br>※ scope이(가) "passive" 이면 필수 |
| signatureKeyId | string | {needSignature} | ✓※|  |  ~ 1024자 | 암호화 키 GRN<br>※ needSignature이(가) "true" 이면 필수 |
| approveRequirement | 문자열 열거형<br>enum {<br>"required",<br>"optional"<br>}<br> | {scope} == "active" | | "required" |  | 승인 필요 여부<br>이 버전 모델에 대한 사용자 승인이 필수인지 임의인지를 제어합니다. "required"인 경우, 사용자가 현재 버전을 승인하지 않으면 버전 체크가 실패합니다. "optional"인 경우, 승인 상태와 관계없이 버전 체크가 통과합니다. 스코프가 "active"인 경우에만 적용됩니다.required: 승인 필요 / optional: 임의 승인 / <br>※ scope이(가) "active" 이면 필수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [VersionModelMaster](#versionmodelmaster) | 작성한 버전 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CreateVersionModelMaster(
    &version.CreateVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("version-0001"),
        Description: nil,
        Metadata: nil,
        Scope: pointy.String("passive"),
        Type: nil,
        CurrentVersion: &version.Version{
            Major: pointy.Int32(1),
            Minor: pointy.Int32(1),
            Micro: pointy.Int32(1),
        },
        WarningVersion: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
        ErrorVersion: &version.Version{
            Major: pointy.Int32(1),
            Minor: pointy.Int32(1),
            Micro: pointy.Int32(1),
        },
        ScheduleVersions: nil,
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: nil,
        ApproveRequirement: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CreateVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->createVersionModelMaster(
        (new CreateVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("version-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withScope("passive")
            ->withType(null)
            ->withCurrentVersion((new \Gs2\Version\Model\Version())
                ->withMajor(1)
                ->withMinor(1)
                ->withMicro(1))
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(1)
                ->withMinor(1)
                ->withMicro(1))
            ->withScheduleVersions(null)
            ->withNeedSignature(false)
            ->withSignatureKeyId(null)
            ->withApproveRequirement(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CreateVersionModelMasterRequest;
import io.gs2.version.result.CreateVersionModelMasterResult;

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

try {
    CreateVersionModelMasterResult result = client.createVersionModelMaster(
        new CreateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(new io.gs2.version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withWarningVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withErrorVersion(new io.gs2.version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CreateVersionModelMasterResult> asyncResult = null;
yield return client.CreateVersionModelMaster(
    new Gs2.Gs2Version.Request.CreateVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("version-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithScope("passive")
        .WithType(null)
        .WithCurrentVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(1)
            .WithMinor(1)
            .WithMicro(1))
        .WithWarningVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2))
        .WithErrorVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(1)
            .WithMinor(1)
            .WithMicro(1))
        .WithScheduleVersions(null)
        .WithNeedSignature(false)
        .WithSignatureKeyId(null)
        .WithApproveRequirement(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.createVersionModelMaster(
        new Gs2Version.CreateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.create_version_model_master(
        version.CreateVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('version-0001')
            .with_description(None)
            .with_metadata(None)
            .with_scope('passive')
            .with_type(None)
            .with_current_version(
                version.Version()
                    .with_major(1)
                    .with_minor(1)
                    .with_micro(1))
            .with_warning_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
            .with_error_version(
                version.Version()
                    .with_major(1)
                    .with_minor(1)
                    .with_micro(1))
            .with_schedule_versions(None)
            .with_need_signature(False)
            .with_signature_key_id(None)
            .with_approve_requirement(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.create_version_model_master({
    namespaceName="namespace-0001",
    name="version-0001",
    description=nil,
    metadata=nil,
    scope="passive",
    type=nil,
    currentVersion={
        major=1,
        minor=1,
        micro=1,
    },
    warningVersion={
        major=2,
        minor=2,
        micro=2,
    },
    errorVersion={
        major=1,
        minor=1,
        micro=1,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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('version')

api_result_handler = client.create_version_model_master_async({
    namespaceName="namespace-0001",
    name="version-0001",
    description=nil,
    metadata=nil,
    scope="passive",
    type=nil,
    currentVersion={
        major=1,
        minor=1,
        micro=1,
    },
    warningVersion={
        major=2,
        minor=2,
        micro=2,
    },
    errorVersion={
        major=1,
        minor=1,
        micro=1,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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;

```



---

### getVersionModelMaster

버전 모델 마스터 조회<br>

스코프, 버전 임계값, 일정 기반 규칙, 서명 설정, 승인 요건을 포함한 지정된 버전 모델 마스터를 조회합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [VersionModelMaster](#versionmodelmaster) | 버전 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetVersionModelMaster(
    &version.GetVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getVersionModelMaster(
        (new GetVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetVersionModelMasterRequest;
import io.gs2.version.result.GetVersionModelMasterResult;

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

try {
    GetVersionModelMasterResult result = client.getVersionModelMaster(
        new GetVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetVersionModelMasterResult> asyncResult = null;
yield return client.GetVersionModelMaster(
    new Gs2.Gs2Version.Request.GetVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getVersionModelMaster(
        new Gs2Version.GetVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.get_version_model_master(
        version.GetVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.get_version_model_master({
    namespaceName="namespace-0001",
    versionName="version-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('version')

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

```



---

### updateVersionModelMaster

버전 모델 마스터 갱신<br>

지정된 버전 모델 마스터의 스코프, 버전 임계값, 일정 기반 규칙, 서명 설정, 승인 요건을 갱신합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| versionName | string |  | ✓|  |  ~ 128자 | 버전 모델 이름<br>버전 모델 고유의 이름입니다. 영숫자 및 -(하이픈), _(밑줄), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| scope | 문자열 열거형<br>enum {<br>"passive",<br>"active"<br>}<br> |  | ✓|  |  | 판정에 사용할 버전 값의 종류<br>버전 체크에 사용할 버전 값을 얻는 방법을 결정합니다. "passive"는 체크 시점에 클라이언트가 현재 버전을 신고하는 방식이며, "active"는 사용자가 과거에 명시적으로 승인한 버전(이용약관 동의 등)을 사용하는 방식입니다.passive: 클라이언트에서 전송 / active: 과거 명시적으로 승인한 버전 /  |
| type | 문자열 열거형<br>enum {<br>"simple",<br>"schedule"<br>}<br> |  | | "simple" |  | 버전 체크 모드<br>버전 체크 방식을 선택합니다. "simple"은 고정된 경고·에러 버전 임계값을 사용하며, "schedule"은 GS2-Schedule의 이벤트를 이용하여 시기에 따라 다른 버전 임계값을 적용합니다.simple: 심플 / schedule: 시계열 전환 /  |
| currentVersion | [Version](#version) | {type} == "simple" and {scope} == "active" | ✓※|  |  | 현재 버전<br>이 버전 모델의 최신 버전입니다. "simple" 모드의 "active" 스코프에서만 사용되며, 사용자가 버전 업데이트를 승인·확인할 때 현재 버전을 알립니다.<br>※ type이(가) "simple"이고 scope이(가) "active" 이면 필수 |
| warningVersion | [Version](#version) | {type} == "simple" | ✓※|  |  | 버전 업그레이드를 촉구하는 버전<br>업그레이드 알림을 표시하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮은 경우에도 로그인은 허용되지만 사용자에게 업그레이드가 권장됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| errorVersion | [Version](#version) | {type} == "simple" | ✓※|  |  | 버전 체크에서 에러로 판정되는 버전<br>로그인을 허용하는 최소 버전 임계값입니다. 클라이언트의 버전이 이 값보다 낮으면 버전 체크가 에러로 판정되어 로그인이 차단됩니다. 비교는 메이저, 마이너, 마이크로 순으로 계층적으로 수행됩니다.<br>※ type이(가) "simple" 이면 필수 |
| scheduleVersions | [List&lt;ScheduleVersion&gt;](#scheduleversion) | {type} == "schedule" | |  | 0 ~ 10 items | 시계열로 전환되는 버전 체크 내용 목록<br>GS2-Schedule의 이벤트를 기준으로 서로 다른 시점에 유효해지는 버전 체크 설정 목록입니다. 업데이트를 필수로 만들기 전에 경고를 표시하는 등 단계적인 버전 강제가 가능해집니다.<br>※ type이(가) "schedule" 이면 활성화 |
| needSignature | bool | {scope} == "passive" | ✓※|  |  | 판정할 버전 값에 서명 검증이 필요한지 여부<br>활성화하면 클라이언트는 버전 신고와 함께 암호 서명을 제공해야 합니다. 이를 통해 클라이언트가 버전 체크를 회피하기 위해 허위 버전을 신고하는 것을 방지합니다. 스코프가 "passive"인 경우에만 적용됩니다.<br>※ scope이(가) "passive" 이면 필수 |
| signatureKeyId | string | {needSignature} | ✓※|  |  ~ 1024자 | 암호화 키 GRN<br>※ needSignature이(가) "true" 이면 필수 |
| approveRequirement | 문자열 열거형<br>enum {<br>"required",<br>"optional"<br>}<br> | {scope} == "active" | | "required" |  | 승인 필요 여부<br>이 버전 모델에 대한 사용자 승인이 필수인지 임의인지를 제어합니다. "required"인 경우, 사용자가 현재 버전을 승인하지 않으면 버전 체크가 실패합니다. "optional"인 경우, 승인 상태와 관계없이 버전 체크가 통과합니다. 스코프가 "active"인 경우에만 적용됩니다.required: 승인 필요 / optional: 임의 승인 / <br>※ scope이(가) "active" 이면 필수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [VersionModelMaster](#versionmodelmaster) | 갱신한 버전 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateVersionModelMaster(
    &version.UpdateVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
        Scope: pointy.String("active"),
        Type: nil,
        CurrentVersion: &version.Version{
            Major: pointy.Int32(3),
            Minor: pointy.Int32(0),
            Micro: pointy.Int32(0),
        },
        WarningVersion: &version.Version{
            Major: pointy.Int32(3),
            Minor: pointy.Int32(3),
            Micro: pointy.Int32(3),
        },
        ErrorVersion: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
        ScheduleVersions: nil,
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: nil,
        ApproveRequirement: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateVersionModelMaster(
        (new UpdateVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withDescription("description1")
            ->withMetadata("{\"hoge\": \"fuga\"}")
            ->withScope("active")
            ->withType(null)
            ->withCurrentVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(0)
                ->withMicro(0))
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(3)
                ->withMicro(3))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withScheduleVersions(null)
            ->withNeedSignature(false)
            ->withSignatureKeyId(null)
            ->withApproveRequirement(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateVersionModelMasterRequest;
import io.gs2.version.result.UpdateVersionModelMasterResult;

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

try {
    UpdateVersionModelMasterResult result = client.updateVersionModelMaster(
        new UpdateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withScope("active")
            .withType(null)
            .withCurrentVersion(new io.gs2.version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withWarningVersion(new io.gs2.version.model.Version()
                .withMajor(3)
                .withMinor(3)
                .withMicro(3))
            .withErrorVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateVersionModelMasterResult> asyncResult = null;
yield return client.UpdateVersionModelMaster(
    new Gs2.Gs2Version.Request.UpdateVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithDescription("description1")
        .WithMetadata("{\"hoge\": \"fuga\"}")
        .WithScope("active")
        .WithType(null)
        .WithCurrentVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(0)
            .WithMicro(0))
        .WithWarningVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(3)
            .WithMicro(3))
        .WithErrorVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2))
        .WithScheduleVersions(null)
        .WithNeedSignature(false)
        .WithSignatureKeyId(null)
        .WithApproveRequirement(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateVersionModelMaster(
        new Gs2Version.UpdateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withScope("active")
            .withType(null)
            .withCurrentVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(3)
                .withMicro(3))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.update_version_model_master(
        version.UpdateVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_description('description1')
            .with_metadata('{"hoge": "fuga"}')
            .with_scope('active')
            .with_type(None)
            .with_current_version(
                version.Version()
                    .with_major(3)
                    .with_minor(0)
                    .with_micro(0))
            .with_warning_version(
                version.Version()
                    .with_major(3)
                    .with_minor(3)
                    .with_micro(3))
            .with_error_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
            .with_schedule_versions(None)
            .with_need_signature(False)
            .with_signature_key_id(None)
            .with_approve_requirement(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.update_version_model_master({
    namespaceName="namespace-0001",
    versionName="version-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    scope="active",
    type=nil,
    currentVersion={
        major=3,
        minor=0,
        micro=0,
    },
    warningVersion={
        major=3,
        minor=3,
        micro=3,
    },
    errorVersion={
        major=2,
        minor=2,
        micro=2,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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('version')

api_result_handler = client.update_version_model_master_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    scope="active",
    type=nil,
    currentVersion={
        major=3,
        minor=0,
        micro=0,
    },
    warningVersion={
        major=3,
        minor=3,
        micro=3,
    },
    errorVersion={
        major=2,
        minor=2,
        micro=2,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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;

```



---

### deleteVersionModelMaster

버전 모델 마스터 삭제<br>

지정된 버전 모델 마스터를 삭제합니다. 이는 마스터 정의만 삭제하며, 현재 활성화된 버전 설정에는 영향을 미치지 않습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [VersionModelMaster](#versionmodelmaster) | 삭제한 버전 모델 마스터 |

#### 구현 예제




**Go**
```go

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

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

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

client := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteVersionModelMaster(
    &version.DeleteVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DeleteVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->deleteVersionModelMaster(
        (new DeleteVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteVersionModelMasterRequest;
import io.gs2.version.result.DeleteVersionModelMasterResult;

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

try {
    DeleteVersionModelMasterResult result = client.deleteVersionModelMaster(
        new DeleteVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DeleteVersionModelMasterResult> asyncResult = null;
yield return client.DeleteVersionModelMaster(
    new Gs2.Gs2Version.Request.DeleteVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.deleteVersionModelMaster(
        new Gs2Version.DeleteVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import version

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

try:
    result = client.delete_version_model_master(
        version.DeleteVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('version')

api_result = client.delete_version_model_master({
    namespaceName="namespace-0001",
    versionName="version-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('version')

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

```



---



