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

# GS2-Inventory SDK API 레퍼런스

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



## 모델

### Namespace

네임스페이스<br>

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

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


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | ※ |  |  ~ 1024자 | 네임스페이스 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  |  |  |  | 트랜잭션 설정<br>아이템 획득 및 소비 등의 인벤토리 조작에 대한 분산 트랜잭션 처리를 설정합니다. 원활한 실행을 위한 자동 실행 모드, 여러 리소스에 대한 일관된 조작을 위한 원자적 커밋(atomic commit), 대규모 보상 배포를 위한 비동기 처리를 지원합니다. |
| acquireScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`acquire`](../script/#acquire) |
| overflowScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 입수 상한에 도달하여 입수할 수 없었을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`overflowDone`](../script/#overflowdone) |
| consumeScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`consume`](../script/#consume) |
| simpleItemAcquireScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 심플 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`simpleItemAcquire`](../script/#simpleitemacquire) |
| simpleItemConsumeScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 심플 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`simpleItemConsume`](../script/#simpleitemconsume) |
| bigItemAcquireScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 거대 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`bigItemAcquire`](../script/#bigitemacquire) |
| bigItemConsumeScript | [ScriptSetting](#scriptsetting) |  |  |  |  | 거대 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`bigItemConsume`](../script/#bigitemconsume) |
| 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" 이면 필수 |

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



---

### Inventory

인벤토리<br>

인벤토리는 게임 플레이어가 소유한 아이템을 보관하기 위한 가방과 같은 것입니다.<br>
가방에는 용량이 있으며, 플레이어마다 용량을 확장할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryId | string |  | ※ |  |  ~ 1024자 | 인벤토리 GRN<br>※ 서버가 자동으로 설정 |
| inventoryName | string |  | ✓ |  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| currentInventoryCapacityUsage | int |  |  | 0 | 0 ~ 2147483646 | 용량 사용량<br>아이템 세트에 의해 현재 사용되고 있는 인벤토리 슬롯의 수입니다. 새로운 아이템 스택이 추가될 때(예: allowMultipleStacks에 의해 새로운 슬롯이 생성될 때) 증가하고, 아이템 세트가 완전히 소비되거나 삭제될 때 감소합니다. currentInventoryMaxCapacity를 초과할 수 없습니다. |
| currentInventoryMaxCapacity | int |  | ✓ |  | 1 ~ 2147483646 | 최대 용량<br>이 사용자가 사용할 수 있는 인벤토리 슬롯의 현재 최대 수입니다. 인벤토리 모델의 initialCapacity로 초기화되며, 입수 액션 또는 직접적인 API 호출을 통해 모델의 maxCapacity까지 확장할 수 있습니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeInventories - 인벤토리 목록 취득
describeInventoriesByUserId - 사용자 ID를 지정하여 인벤토리 목록을 취득
getInventory - 인벤토리를 취득
getInventoryByUserId - 사용자 ID를 지정하여 인벤토리를 취득
addCapacityByUserId - 사용자 ID를 지정하여 인벤토리의 용량 크기를 가산
setCapacityByUserId - 사용자 ID를 지정하여 인벤토리의 용량 크기를 설정
deleteInventoryByUserId - 인벤토리를 삭제
verifyInventoryCurrentMaxCapacity - 현재 인벤토리의 최대 용량을 검증
verifyInventoryCurrentMaxCapacityByUserId - 사용자 ID를 지정하여 인벤토리의 최대 용량을 검증
getItemSet - 아이템 세트 취득
getItemSetByUserId - 사용자 ID를 지정하여 아이템 세트 취득
getItemWithSignature - 서명과 함께 아이템 세트 취득
getItemWithSignatureByUserId - 사용자 ID를 지정하여 서명이 포함된 아이템 세트 취득
acquireItemSetByUserId - 사용자 ID를 지정하여 아이템 세트 입수
acquireItemSetWithGradeByUserId - 사용자 ID를 지정하여 GS2-Grade에 그레이드를 설정하면서 아이템 세트를 1개 입수
consumeItemSet - 아이템 세트를 소비
consumeItemSetByUserId - 사용자 ID를 지정하여 아이템 세트를 소비
deleteItemSetByUserId - 아이템 세트를 삭제
describeReferenceOf - 참조원 목록을 취득
describeReferenceOfByUserId - 사용자 ID를 지정하여 참조원 목록을 취득
getReferenceOf - 참조원을 취득
getReferenceOfByUserId - 사용자 ID를 지정하여 참조원을 취득
verifyReferenceOf - 아이템의 참조원을 검증
verifyReferenceOfByUserId - 사용자 ID를 지정하여 아이템의 참조원을 검증
addReferenceOf - 참조원을 추가
addReferenceOfByUserId - 사용자 ID를 지정하여 아이템에 참조원을 추가
deleteReferenceOf - 참조원을 삭제
deleteReferenceOfByUserId - 사용자 ID를 지정하여 아이템의 참조원을 삭제



---

### ItemSet

아이템 세트<br>

아이템 세트는 게임 플레이어의 인벤토리 내에 저장된 소유물을 나타냅니다.<br>
인벤토리 모델명과 아이템 모델명, 소지 수량, 유효기간 등을 보유합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemSetId | string |  | ※ |  |  ~ 1024자 | 아이템 세트 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ | UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| inventoryName | string |  | ✓ |  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓ |  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| count | long |  | ✓ |  | 1 ~ 9223372036854775805 | 소지 수량<br>이 스택 내의 아이템 수입니다. 1부터 아이템 모델의 스택 상한까지의 범위입니다. 아이템을 입수하면 스택 상한까지 수량이 증가하고, 소비하면 감소합니다. 수량이 0이 되면 아이템 세트는 삭제되고 인벤토리 슬롯이 해제됩니다. |
| referenceOf | List&lt;string&gt; |  |  | [] | 0 ~ 24 items | 참조원 목록<br>이 아이템 세트에 등록된 외부 참조입니다. 어떤 시스템이 이 아이템을 사용하고 있는지(예: 무기로 장비, 편성에 할당)를 추적하는 데 사용됩니다. 아이템 세트당 최대 24개의 참조입니다. |
| sortValue | int |  | ✓ |  | 0 ~ 2147483646 | 표시 순서<br>아이템 모델의 sortValue에서 복사된 숫자 값으로, 인벤토리 내에서 아이템 세트를 표시용으로 정렬하는 데 사용됩니다. 값이 작을수록 먼저 표시됩니다. |
| expiresAt | long |  |  | 0 |  | 유효기간<br>UNIX 시간·밀리초 |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |

**관련 메서드:**
describeItemSets - 아이템 세트 목록 취득
describeItemSetsByUserId - 사용자 ID를 지정하여 아이템 세트 목록 취득
getItemSet - 아이템 세트 취득
getItemSetByUserId - 사용자 ID를 지정하여 아이템 세트 취득
getItemWithSignature - 서명과 함께 아이템 세트 취득
getItemWithSignatureByUserId - 사용자 ID를 지정하여 서명이 포함된 아이템 세트 취득
acquireItemSetByUserId - 사용자 ID를 지정하여 아이템 세트 입수
acquireItemSetWithGradeByUserId - 사용자 ID를 지정하여 GS2-Grade에 그레이드를 설정하면서 아이템 세트를 1개 입수
consumeItemSet - 아이템 세트를 소비
consumeItemSetByUserId - 사용자 ID를 지정하여 아이템 세트를 소비
deleteItemSetByUserId - 아이템 세트를 삭제
verifyItemSet - 아이템 세트의 소지 수량 검증
verifyItemSetByUserId - 사용자 ID를 지정하여 아이템 세트의 소지 수량 검증
describeReferenceOf - 참조원 목록을 취득
describeReferenceOfByUserId - 사용자 ID를 지정하여 참조원 목록을 취득
getReferenceOf - 참조원을 취득
getReferenceOfByUserId - 사용자 ID를 지정하여 참조원을 취득
verifyReferenceOf - 아이템의 참조원을 검증
verifyReferenceOfByUserId - 사용자 ID를 지정하여 아이템의 참조원을 검증
addReferenceOf - 참조원을 추가
addReferenceOfByUserId - 사용자 ID를 지정하여 아이템에 참조원을 추가
deleteReferenceOf - 참조원을 삭제
deleteReferenceOfByUserId - 사용자 ID를 지정하여 아이템의 참조원을 삭제



---

### ReferenceOf

소지품의 참조원<br>

장비 슬롯이나 편성 바인드 등, 아이템 세트에 등록된 외부 참조를 나타냅니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 활성 참조원을 가진 아이템 세트는 소비나 삭제로부터 보호되어 사용 중인 아이템이 실수로 삭제되는 것을 방지합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| referenceOfId | string |  | ※ |  |  ~ 1024자 | 참조 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 아이템 세트를 식별하는 이름<br>이 참조가 부여된 아이템 세트의 UUID 이름입니다. 인벤토리 내의 어떤 특정 아이템 스택이 외부 시스템에서 참조되고 있는지를 식별하기 위해 사용됩니다. |


---

### SimpleInventory

심플 인벤토리<br>

심플 인벤토리는 게임 플레이어가 소유한 심플 아이템을 저장하기 위한 가방과 같은 것입니다.<br>
심플 인벤토리에는 아이템 소지 수 상한이나 인벤토리 용량과 같은 기능은 없지만, 여러 아이템을 한꺼번에 증감시킬 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryId | string |  | ※ |  |  ~ 1024자 | 심플 인벤토리 GRN<br>※ 서버가 자동으로 설정 |
| inventoryName | string |  | ✓ |  |  ~ 128자 | 심플 인벤토리 모델명<br>이 인벤토리의 아이템 종류를 정의하는 심플 인벤토리 모델의 이름입니다. 사용자의 심플 인벤토리 인스턴스를 모델 정의에 연결합니다. |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| simpleItems | [List&lt;SimpleItem&gt;](#simpleitem) |  |  | [] | 0 ~ 1000 items | 심플 아이템 목록<br>이 심플 인벤토리에 저장된 모든 아이템 소지품입니다. 여러 아이템을 한 번의 배치 작업으로 획득하거나 소비할 수 있습니다. 심플 인벤토리당 최대 1000개의 아이템입니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |


---

### SimpleItem

심플 아이템<br>

심플 아이템은 게임 플레이어의 인벤토리 내에 저장된 소유물을 나타냅니다.<br>
심플 아이템은 모델 이름과 소지 수량을 가집니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemId | string |  | ※ |  |  ~ 1024자 | 심플 아이템 GRN<br>※ 서버가 자동으로 설정 |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓ |  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| count | long |  | ✓ |  | 0 ~ 9223372036854775805 | 소지 수량<br>사용자가 소지한 이 아이템 종류의 수량입니다. 일반적인 인벤토리 아이템과 달리 심플 아이템에는 스택 상한이 없으며, 수량은 int64 범위 내에서 임의의 값을 가질 수 있습니다. 다른 심플 아이템과 함께 일괄 처리로 증감할 수 있습니다. |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeSimpleItems - 심플 아이템 목록 조회
describeSimpleItemsByUserId - 사용자 ID를 지정하여 심플 아이템 목록 조회
getSimpleItem - 심플 아이템 조회
getSimpleItemByUserId - 사용자 ID를 지정하여 심플 아이템 조회
getSimpleItemWithSignature - 서명과 함께 심플 아이템 조회
getSimpleItemWithSignatureByUserId - 사용자 ID를 지정하여 서명이 포함된 심플 아이템 조회
acquireSimpleItemsByUserId - 사용자 ID를 지정하여 심플 아이템 입수
consumeSimpleItems - 심플 아이템 소비
consumeSimpleItemsByUserId - 사용자 ID를 지정하여 심플 아이템 소비
setSimpleItemsByUserId - 사용자 ID를 지정하여 심플 아이템 설정
verifySimpleItem - 심플 아이템 소지 수량 검증
verifySimpleItemByUserId - 사용자 ID를 지정하여 심플 아이템 소지 수량 검증


**관련 모델:**
SimpleInventory - 심플 인벤토리



---

### BigInventory

거대 인벤토리<br>

거대 인벤토리는 일반 인벤토리에서는 다룰 수 없는 큰 수량의 아이템을 게임 플레이어별로 관리하기 위한 가방과 같은 구조입니다.<br>
거대 아이템은 아이템 소지 수량을 int64 범위를 초과하여 보유할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryId | string |  | ※ |  |  ~ 1024자 | 거대 인벤토리 GRN<br>※ 서버가 자동으로 설정 |
| inventoryName | string |  | ✓ |  |  ~ 128자 | 거대 인벤토리 모델명<br>이 인벤토리의 아이템 종류를 정의하는 거대 인벤토리 모델의 이름입니다. 사용자의 거대 인벤토리 인스턴스를 모델 정의에 연결합니다. |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| bigItems | [List&lt;BigItem&gt;](#bigitem) |  |  |  | 0 ~ 1000 items | 거대 아이템 목록<br>이 거대 인벤토리에 저장된 모든 거대 아이템 소지품입니다. 각 아이템은 거대 십진 정수 문자열로 수량을 보유합니다. 거대 인벤토리당 최대 1000개의 아이템입니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |


---

### BigItem

거대 아이템<br>

거대 아이템은 게임 플레이어의 거대 인벤토리 내에 저장되어 있는 소유물을 나타냅니다.<br>
거대 아이템 모델 이름과, int64 범위를 초과하는 소지 수량을 보유합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemId | string |  | ※ |  |  ~ 1024자 | 거대 아이템 GRN<br>※ 서버가 자동으로 설정 |
| userId | string |  | ✓ |  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓ |  |  ~ 128자 | 거대 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 거대 아이템 모델의 이름입니다. 이 거대 아이템 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| count | string |  | ✓ |  |  ~ 1024자 | 소지 수량<br>최대 1024자리까지의 정수값 문자열 |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeBigItems - 거대 아이템 목록 조회
describeBigItemsByUserId - 사용자 ID를 지정하여 거대 아이템 목록 조회
getBigItem - 거대 아이템 조회
getBigItemByUserId - 사용자 ID를 지정하여 거대 아이템 조회
acquireBigItemByUserId - 사용자 ID를 지정하여 거대 아이템 입수
consumeBigItem - 거대 아이템 소비
consumeBigItemByUserId - 사용자 ID를 지정하여 거대 아이템 소비
setBigItemByUserId - 사용자 ID를 지정하여 거대 아이템 설정
deleteBigItemByUserId - 거대 아이템 삭제
verifyBigItem - 거대 아이템의 소지 수량 검증
verifyBigItemByUserId - 사용자 ID를 지정하여 거대 아이템의 소지 수량 검증


**관련 모델:**
BigInventory - 거대 인벤토리



---

### InventoryModel

인벤토리 모델<br>

인벤토리는 게임 플레이어가 소유한 아이템을 담는 가방과 같은 것입니다.<br>
인벤토리에는 용량을 설정할 수 있으며, 용량을 초과하여 소유할 수 없습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryModelId | string |  | ※ |  |  ~ 1024자 | 인벤토리 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 인벤토리 모델 이름<br>인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| initialCapacity | int |  | ✓ |  | 0 ~ 2147483646 | 초기 크기<br>인벤토리가 처음 생성될 때 사용자에게 제공되는 인벤토리 칸의 수입니다. 각 칸에는 하나의 아이템 스택을 저장할 수 있습니다. 사용자는 게임 플레이 액션을 통해 maxCapacity까지 용량을 확장할 수 있습니다. |
| maxCapacity | int |  | ✓ |  | 0 ~ 2147483646 | 최대 크기<br>사용자가 확장할 수 있는 인벤토리 칸의 상한값입니다. 이 값을 초과하여 용량을 늘릴 수 없습니다. 모든 칸이 사용 중이고 아이템을 더 이상 스택할 수 없는 경우, 오버플로우 스크립트가 초과분을 처리하지 않는 한 입수는 실패합니다. |
| protectReferencedItem | bool? |  |  | false |  | 참조된 아이템 보호<br>활성화하면 (referenceOf 메커니즘을 통해) 참조가 등록된 아이템 세트는 소비하거나 삭제할 수 없게 됩니다. 다른 시스템에서 사용 중인 아이템(예: 장착 중인 장비, 편성에 연결된 아이템)이 실수로 삭제되는 것을 방지합니다. |
| itemModels | [List&lt;ItemModel&gt;](#itemmodel) |  |  | [] | 1 ~ 1000 items | 아이템 모델 목록<br>이 인벤토리에 저장할 수 있는 아이템의 종류입니다. 각 아이템 모델은 한 종류의 아이템에 대한 스택 및 입수 동작을 정의합니다. 인벤토리 모델당 최대 1000개의 아이템 모델까지 설정할 수 있습니다. |

**관련 메서드:**
describeInventoryModels - 인벤토리 모델 목록 취득
getInventoryModel - 인벤토리 모델을 취득



---

### ItemModel

아이템 모델<br>

아이템은 포션 ×99 처럼, 하나의 인벤토리 칸에 여러 개를 모아서 소지할 수 있습니다.<br>
이렇게 한 칸에 여러 개를 모으는 것을 "스택"이라고 하며, 아이템마다 스택 가능한 상한 수를 설정할 수 있습니다.<br>

스택 상한에 도달했을 때의 동작도 아이템마다 설정할 수 있습니다.<br>
구체적으로는 다음 중 하나를 선택할 수 있습니다:<br>

- 새로운 인벤토리 칸을 추가하여 추가로 소지할 수 있도록 한다<br>
- 상한에 도달했으므로 더 이상 입수할 수 없도록 한다


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemModelId | string |  | ※ |  |  ~ 1024자 | 아이템 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 아이템 모델 이름<br>아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>GS2-Enhance에는 GS2-Inventory와 연동하여 강화를 수행하는 메커니즘이 있으며, ItemModel의 메타데이터에 JSON 형식으로 강화 소재로 사용했을 때의 경험치량을 설정합니다.<br>자세한 내용은 [마이크로서비스 소개 / GS2-Enhance](/microservices/enhance/#강화-레이트) 항목에서 설명합니다. |
| stackingLimit | long |  | ✓ |  | 1 ~ 9223372036854775805 | 스택 가능한 최대 수량<br>하나의 인벤토리 칸(스택)에 보관할 수 있는 이 아이템의 최대 수입니다. 이 상한에 도달하면 allowMultipleStacks 설정에 따라 새로운 칸이 할당되거나 추가 입수가 차단됩니다. |
| allowMultipleStacks | bool |  | ✓ |  |  | 복수 스택 허용<br>활성화하면 스택 상한에 도달했을 때 새로운 인벤토리 칸이 자동으로 할당되어 이 아이템의 추가 수량을 저장합니다(추가 용량을 소비합니다). 비활성화하면 기존 칸에서 스택 상한에 도달한 시점에 입수가 차단됩니다. |
| sortValue | int |  | ✓ |  | 0 ~ 2147483646 | 표시 순서<br>인벤토리 내 아이템을 표시용으로 정렬하기 위한 수치입니다. 값이 작을수록 먼저 표시됩니다. 이 값은 ItemSet 레코드에도 복사되어 소지 아이템의 일관된 정렬을 가능하게 합니다. |

**관련 메서드:**
getItemSet - 아이템 세트 취득
getItemSetByUserId - 사용자 ID를 지정하여 아이템 세트 취득
getItemWithSignature - 서명과 함께 아이템 세트 취득
getItemWithSignatureByUserId - 사용자 ID를 지정하여 서명이 포함된 아이템 세트 취득
acquireItemSetByUserId - 사용자 ID를 지정하여 아이템 세트 입수
acquireItemSetWithGradeByUserId - 사용자 ID를 지정하여 GS2-Grade에 그레이드를 설정하면서 아이템 세트를 1개 입수
consumeItemSet - 아이템 세트를 소비
consumeItemSetByUserId - 사용자 ID를 지정하여 아이템 세트를 소비
deleteItemSetByUserId - 아이템 세트를 삭제
describeReferenceOf - 참조원 목록을 취득
describeReferenceOfByUserId - 사용자 ID를 지정하여 참조원 목록을 취득
getReferenceOf - 참조원을 취득
getReferenceOfByUserId - 사용자 ID를 지정하여 참조원을 취득
verifyReferenceOf - 아이템의 참조원을 검증
verifyReferenceOfByUserId - 사용자 ID를 지정하여 아이템의 참조원을 검증
addReferenceOf - 참조원을 추가
addReferenceOfByUserId - 사용자 ID를 지정하여 아이템에 참조원을 추가
deleteReferenceOf - 참조원을 삭제
deleteReferenceOfByUserId - 사용자 ID를 지정하여 아이템의 참조원을 삭제
describeItemModels - 아이템 모델 목록 취득
getItemModel - 아이템 모델 취득


**관련 모델:**
InventoryModel - 인벤토리 모델



---

### SimpleInventoryModel

심플 인벤토리 모델<br>

일반적인 InventoryModel에서는 인벤토리 안에 저장할 수 있는 아이템의 용량 제한을 설정할 수 있었습니다.<br>
하지만 심플 인벤토리에는 그러한 기능이 없으며, 단순히 아이템의 소지 수량을 보유할 뿐입니다.<br>

다만 심플 인벤토리에서는 여러 아이템의 증감 처리를 한 번의 처리로 실행할 수 있는 API를 사용할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryModelId | string |  | ※ |  |  ~ 1024자 | 심플 인벤토리 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| simpleItemModels | [List&lt;SimpleItemModel&gt;](#simpleitemmodel) |  |  | [] | 1 ~ 1000 items | 심플 아이템 모델 목록<br>이 심플 인벤토리에 저장할 수 있는 아이템의 종류입니다. 일반적인 인벤토리와 달리 심플 아이템에는 스택 상한이나 용량 제약이 없습니다. 심플 인벤토리 모델당 최대 1000개의 아이템 모델을 사용할 수 있습니다. |

**관련 메서드:**
describeSimpleInventoryModels - 심플 인벤토리 모델 목록 취득
getSimpleInventoryModel - 심플 인벤토리 모델 취득



---

### SimpleItemModel

심플 아이템 모델<br>

ItemModel에서는 스택할 수 있는 수량의 최댓값을 설정할 수 있어, 일정 수를 초과하는 경우 여러 스택으로 나누는 구현이 가능했습니다.<br>
심플 아이템에는 그러한 기능이 없으며, 단순히 아이템의 소지 수량만을 보관합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemModelId | string |  | ※ |  |  ~ 1024자 | 심플 아이템 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 심플 아이템 모델 이름<br>심플 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

**관련 메서드:**
getSimpleItem - 심플 아이템 조회
getSimpleItemByUserId - 사용자 ID를 지정하여 심플 아이템 조회
getSimpleItemWithSignature - 서명과 함께 심플 아이템 조회
getSimpleItemWithSignatureByUserId - 사용자 ID를 지정하여 서명이 포함된 심플 아이템 조회
describeSimpleItemModels - 심플 아이템 모델 목록 취득
getSimpleItemModel - 심플 아이템 모델을 취득


**관련 모델:**
SimpleInventoryModel - 심플 인벤토리 모델



---

### BigInventoryModel

거대 인벤토리 모델<br>

일반적인 InventoryModel이나 SimpleInventoryModel에서는 인벤토리에 저장할 수 있는 아이템의 수가 int64 범위로 제한되었습니다.<br>
인플레이션 계열 게임에서는 더 넓은 범위의 값이 필요한 경우가 있습니다.<br>

거대 인벤토리 모델에서는 인벤토리에 저장할 수 있는 아이템의 수가 최대 1024자리의 정수값을 가질 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryModelId | string |  | ※ |  |  ~ 1024자 | 거대 인벤토리 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| bigItemModels | [List&lt;BigItemModel&gt;](#bigitemmodel) |  |  | [] | 1 ~ 1000 items | 거대 아이템 모델 목록<br>이 거대 인벤토리에 저장할 수 있는 아이템의 종류입니다. 각 거대 아이템 모델은 최대 1024자리의 정수 문자열로 표현되는 수량을 보유할 수 있습니다. 거대 인벤토리 모델당 최대 1000개의 아이템 모델까지 설정할 수 있습니다. |

**관련 메서드:**
describeBigInventoryModels - 거대 인벤토리 모델 목록을 취득
getBigInventoryModel - 거대 인벤토리 모델을 취득



---

### BigItemModel

거대 아이템 모델<br>

거대 아이템 모델은 거대 인벤토리 모델에 저장되는 거대 아이템을 정의하는 모델입니다.<br>
거대 아이템은 소지 수량을 int64 범위를 초과하여 보유할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemModelId | string |  | ※ |  |  ~ 1024자 | 거대 아이템 모델 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 거대 아이템 모델 이름<br>거대 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

**관련 메서드:**
getBigItem - 거대 아이템 조회
getBigItemByUserId - 사용자 ID를 지정하여 거대 아이템 조회
describeBigItemModels - 거대 아이템 모델 목록 취득
getBigItemModel - 거대 아이템 모델을 취득


**관련 모델:**
BigInventoryModel - 거대 인벤토리 모델



---

### AcquireCount

심플 아이템의 입수 수량


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemName | string |  | ✓ |  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| count | long |  | ✓ |  | 1 ~ 9223372036854775805 | 입수하는 양 |


---

### ConsumeCount

심플 아이템의 소비 수량


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemName | string |  | ✓ |  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| count | long |  | ✓ |  | 1 ~ 9223372036854775805 | 소비 수량 |


---

### HeldCount

심플 아이템의 소지 수량


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemName | string |  | ✓ |  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| count | long |  | ✓ |  | 0 ~ 9223372036854775805 | 소지 수량 |


---

### CurrentItemModelMaster

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

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

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

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


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

**관련 메서드:**
exportMaster - 아이템 모델 마스터를 활성화 가능한 마스터 데이터 형식으로 내보내기
getCurrentItemModelMaster - 현재 활성화된 아이템 모델의 마스터 데이터를 취득
updateCurrentItemModelMaster - 현재 활성화된 아이템 모델의 마스터 데이터를 갱신
updateCurrentItemModelMasterFromGitHub - 현재 활성화된 아이템 모델의 마스터 데이터를 GitHub에서 갱신



---

### InventoryModelMaster

인벤토리 모델 마스터<br>

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

인벤토리는 게임 플레이어가 소유한 아이템을 저장하는 가방과 같은 것입니다.<br>
인벤토리는 용량을 설정할 수 있으며, 용량을 초과하여 소유할 수 없습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryModelId | string |  | ※ |  |  ~ 1024자 | 인벤토리 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| initialCapacity | int |  | ✓ |  | 0 ~ 2147483646 | 초기 크기<br>인벤토리가 처음 생성될 때 사용자에게 제공되는 인벤토리 칸의 수입니다. 각 칸에는 하나의 아이템 스택을 저장할 수 있습니다. 사용자는 게임 플레이 액션을 통해 maxCapacity까지 용량을 확장할 수 있습니다. |
| maxCapacity | int |  | ✓ |  | 0 ~ 2147483646 | 최대 크기<br>사용자가 확장할 수 있는 인벤토리 칸의 상한값입니다. 이 값을 초과하여 용량을 늘릴 수 없습니다. 모든 칸이 사용 중이고 아이템을 더 이상 스택할 수 없는 경우, 오버플로우 스크립트가 초과분을 처리하지 않는 한 입수는 실패합니다. |
| protectReferencedItem | bool |  |  | false |  | 참조된 아이템 보호<br>활성화하면 (referenceOf 메커니즘을 통해) 참조가 등록된 아이템 세트는 소비하거나 삭제할 수 없게 됩니다. 다른 시스템에서 사용 중인 아이템(예: 장착 중인 장비, 편성에 연결된 아이템)이 실수로 삭제되는 것을 방지합니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeInventoryModelMasters - 인벤토리 모델 마스터 목록 조회
createInventoryModelMaster - 인벤토리 모델 마스터 신규 생성
getInventoryModelMaster - 인벤토리 모델 마스터 조회
updateInventoryModelMaster - 인벤토리 모델 마스터 갱신
deleteInventoryModelMaster - 인벤토리 모델 마스터 삭제



---

### ItemModelMaster

아이템 모델 마스터<br>

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

아이템은 포션 ×99처럼, 하나의 인벤토리 슬롯에 여러 개를 함께 소지할 수 있습니다.<br>
이처럼 한 슬롯에 여러 개를 모으는 것을 "스택"이라고 하며, 아이템마다 스택 가능한 상한 수를 설정할 수 있습니다.<br>

스택 상한에 도달했을 때의 동작도 아이템마다 설정할 수 있습니다.<br>
구체적으로는 다음 중 하나를 선택할 수 있습니다:<br>

- 새 인벤토리 슬롯을 추가하여 계속 입수할 수 있도록 함<br>
- 상한에 도달했으므로 더 이상 입수할 수 없도록 함


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemModelId | string |  | ※ |  |  ~ 1024자 | 아이템 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| inventoryName | string |  | ✓ |  |  ~ 128자 | 인벤토리 모델명<br>이 아이템이 속한 인벤토리 모델의 이름입니다. 이 아이템 종류를 저장할 수 있는 인벤토리를 결정하고, 인벤토리의 용량 설정 및 보호 설정과 연관시킵니다. |
| name | string |  | ✓ |  |  ~ 128자 | 아이템 모델명<br>아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>GS2-Enhance에는 GS2-Inventory와 연동하여 강화를 수행하는 처리가 있으며, ItemModel의 메타데이터에 JSON 형식으로 강화 소재로 사용했을 때의 경험치량을 설정합니다.<br>자세한 내용은 [마이크로서비스 소개 / GS2-Enhance](/microservices/enhance/#강화-레이트) 항목에서 설명하고 있습니다. |
| stackingLimit | long |  | ✓ |  | 1 ~ 9223372036854775805 | 스택 가능한 최대 수량<br>하나의 인벤토리 칸(스택)에 보관할 수 있는 이 아이템의 최대 수입니다. 이 상한에 도달하면 allowMultipleStacks 설정에 따라 새로운 칸이 할당되거나 추가 입수가 차단됩니다. |
| allowMultipleStacks | bool |  | ✓ |  |  | 복수 스택 허용<br>활성화하면 스택 상한에 도달했을 때 새로운 인벤토리 칸이 자동으로 할당되어 이 아이템의 추가 수량을 저장합니다(추가 용량을 소비합니다). 비활성화하면 기존 칸에서 스택 상한에 도달한 시점에 입수가 차단됩니다. |
| sortValue | int |  | ✓ |  | 0 ~ 2147483646 | 표시 순서<br>인벤토리 내 아이템을 표시용으로 정렬하기 위한 수치입니다. 값이 작을수록 먼저 표시됩니다. 이 값은 ItemSet 레코드에도 복사되어 소지 아이템의 일관된 정렬을 가능하게 합니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeItemModelMasters - 아이템 모델 마스터 목록 취득
createItemModelMaster - 아이템 모델 마스터 신규 생성
getItemModelMaster - 아이템 모델 마스터 취득
updateItemModelMaster - 아이템 모델 마스터 갱신
deleteItemModelMaster - 아이템 모델 마스터 삭제



---

### SimpleInventoryModelMaster

심플 인벤토리 모델 마스터<br>

심플 인벤토리 모델 마스터는 게임 내에서 사용되는 심플 인벤토리 모델의 편집 및 관리용 데이터로, 매니지먼트 콘솔의 마스터 데이터 에디터에서 임시로 보관됩니다.<br>
임포트 및 갱신 처리를 수행함으로써, 실제로 게임에서 참조되는 심플 인벤토리 모델로 반영됩니다.<br>

일반적인 InventoryModel에서는 인벤토리 내에 저장할 수 있는 아이템의 용량 제한이 가능했습니다.<br>
하지만 심플 인벤토리에는 그러한 기능이 없으며, 단순히 아이템의 소지 수량만을 보관합니다.<br>

다만 심플 인벤토리에서는 여러 아이템의 증감 처리를 한 번의 처리로 실행할 수 있는 API를 이용할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryModelId | string |  | ※ |  |  ~ 1024자 | 심플 인벤토리 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeSimpleInventoryModelMasters - 심플 인벤토리 모델 마스터 목록 취득
createSimpleInventoryModelMaster - 심플 인벤토리 모델 마스터 신규 생성
getSimpleInventoryModelMaster - 심플 인벤토리 모델 마스터 취득
updateSimpleInventoryModelMaster - 심플 인벤토리 모델 마스터 갱신
deleteSimpleInventoryModelMaster - 심플 인벤토리 모델 마스터 삭제



---

### SimpleItemModelMaster

심플 아이템 모델 마스터<br>

심플 아이템 모델 마스터는 게임 내에서 사용되는 심플 아이템 모델의 편집 및 관리용 데이터로, 매니지먼트 콘솔의 마스터 데이터 에디터에서 임시로 보관됩니다.<br>
임포트 및 갱신 처리를 수행함으로써, 실제로 게임에서 참조되는 심플 아이템 모델로 반영됩니다.<br>

ItemModel에서는 스택할 수 있는 수량의 최댓값을 설정할 수 있어, 일정 수를 초과하는 경우 여러 스택으로 나누는 구현이 가능했습니다.<br>
심플 아이템에는 그러한 기능이 없으며, 단순히 아이템의 소지 수량만을 보관합니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemModelId | string |  | ※ |  |  ~ 1024자 | 심플 아이템 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 심플 아이템 모델 이름<br>심플 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeSimpleItemModelMasters - 심플 아이템 모델 마스터 목록 취득
createSimpleItemModelMaster - 심플 아이템 모델 마스터 신규 생성
getSimpleItemModelMaster - 심플 아이템 모델 마스터 취득
updateSimpleItemModelMaster - 심플 아이템 모델 마스터 갱신
deleteSimpleItemModelMaster - 심플 아이템 모델 마스터 삭제



---

### BigInventoryModelMaster

거대 인벤토리 모델 마스터<br>

거대 인벤토리 모델 마스터는 게임 내에서 사용되는 거대 인벤토리 모델의 편집 및 관리용 데이터로, 매니지먼트 콘솔의 마스터 데이터 에디터에서 임시로 보관됩니다.<br>
임포트 및 갱신 처리를 수행함으로써, 실제로 게임에서 참조되는 거대 인벤토리 모델로 반영됩니다.<br>

일반적인 InventoryModel이나 SimpleInventoryModel에서는 인벤토리에 저장할 수 있는 아이템의 수가 int64 범위로 제한되었습니다.<br>
인플레이션 계열 게임에서는 더 넓은 범위의 값이 필요한 경우가 있습니다.<br>

거대 인벤토리 모델에서는 인벤토리에 저장할 수 있는 아이템의 수가 최대 1024자리의 정수값을 가질 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| inventoryModelId | string |  | ※ |  |  ~ 1024자 | 거대 인벤토리 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeBigInventoryModelMasters - 거대 인벤토리 모델 마스터 목록 취득
createBigInventoryModelMaster - 거대 인벤토리 모델 마스터를 신규 작성
getBigInventoryModelMaster - 거대 인벤토리 모델 마스터를 취득
updateBigInventoryModelMaster - 거대 인벤토리 모델 마스터를 갱신
deleteBigInventoryModelMaster - 거대 인벤토리 모델 마스터를 삭제



---

### BigItemModelMaster

거대 아이템 모델 마스터<br>

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

거대 아이템 모델은 거대 인벤토리 모델에 저장되는 거대 아이템을 정의하는 모델입니다.<br>
거대 아이템은 소지 수량을 int64 범위를 초과하여 보유할 수 있습니다.


|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| itemModelId | string |  | ※ |  |  ~ 1024자 | 거대 아이템 모델 마스터 GRN<br>※ 서버가 자동으로 설정 |
| name | string |  | ✓ |  |  ~ 128자 | 거대 아이템 모델명<br>거대 아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  |  |  |  ~ 1024자 | 설명문 |
| metadata | string |  |  |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| createdAt | long |  | ※ | 현재 시각 |  | 생성일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| updatedAt | long |  | ※ | 현재 시각 |  | 최종 갱신일시<br>UNIX 시간・밀리초<br>※ 서버가 자동으로 설정 |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | 리비전 |

**관련 메서드:**
describeBigItemModelMasters - 거대 아이템 모델 마스터 목록을 취득
createBigItemModelMaster - 거대 아이템 모델 마스터를 신규 생성
getBigItemModelMaster - 거대 아이템 모델 마스터를 취득
updateBigItemModelMaster - 거대 아이템 모델 마스터를 갱신
deleteBigItemModelMaster - 거대 아이템 모델 마스터를 삭제



---
## 메서드

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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>

지정된 설정으로 새로운 인벤토리 네임스페이스를 생성합니다.<br>
표준 인벤토리 아이템에 대해 아이템 획득(acquireScript), 오버플로 처리(overflowScript), 소비(consumeScript)의 GS2-Script 트리거를 설정할 수 있습니다.<br>
심플 아이템(simpleItemAcquireScript, simpleItemConsumeScript)과 빅 아이템(bigItemAcquireScript, bigItemConsumeScript)에는 개별 스크립트 설정을 사용할 수 있습니다.<br>
오버플로 스크립트는 아이템 획득이 인벤토리 용량을 초과할 때 호출되며, GS2-Inbox 등으로의 전송을 가능하게 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | 트랜잭션 설정<br>아이템 획득 및 소비 등의 인벤토리 조작에 대한 분산 트랜잭션 처리를 설정합니다. 원활한 실행을 위한 자동 실행 모드, 여러 리소스에 대한 일관된 조작을 위한 원자적 커밋(atomic commit), 대규모 보상 배포를 위한 비동기 처리를 지원합니다. |
| acquireScript | [ScriptSetting](#scriptsetting) |  | |  |  | 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`acquire`](../script/#acquire) |
| overflowScript | [ScriptSetting](#scriptsetting) |  | |  |  | 입수 상한에 도달하여 입수할 수 없었을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`overflowDone`](../script/#overflowdone) |
| consumeScript | [ScriptSetting](#scriptsetting) |  | |  |  | 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`consume`](../script/#consume) |
| simpleItemAcquireScript | [ScriptSetting](#scriptsetting) |  | |  |  | 심플 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`simpleItemAcquire`](../script/#simpleitemacquire) |
| simpleItemConsumeScript | [ScriptSetting](#scriptsetting) |  | |  |  | 심플 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`simpleItemConsume`](../script/#simpleitemconsume) |
| bigItemAcquireScript | [ScriptSetting](#scriptsetting) |  | |  |  | 거대 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`bigItemAcquire`](../script/#bigitemacquire) |
| bigItemConsumeScript | [ScriptSetting](#scriptsetting) |  | |  |  | 거대 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`bigItemConsume`](../script/#bigitemconsume) |
| 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/inventory"
import "github.com/openlyinc/pointy"

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &inventory.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        AcquireScript: nil,
        OverflowScript: nil,
        ConsumeScript: nil,
        SimpleItemAcquireScript: nil,
        SimpleItemConsumeScript: nil,
        BigItemAcquireScript: nil,
        BigItemConsumeScript: nil,
        LogSetting: &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withAcquireScript(null)
            ->withOverflowScript(null)
            ->withConsumeScript(null)
            ->withSimpleItemAcquireScript(null)
            ->withSimpleItemConsumeScript(null)
            ->withBigItemAcquireScript(null)
            ->withBigItemConsumeScript(null)
            ->withLogSetting((new \Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateNamespaceRequest;
import io.gs2.inventory.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAcquireScript(null)
            .withOverflowScript(null)
            .withConsumeScript(null)
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new io.gs2.inventory.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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Inventory.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithAcquireScript(null)
        .WithOverflowScript(null)
        .WithConsumeScript(null)
        .WithSimpleItemAcquireScript(null)
        .WithSimpleItemConsumeScript(null)
        .WithBigItemAcquireScript(null)
        .WithBigItemConsumeScript(null)
        .WithLogSetting(new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.createNamespace(
        new Gs2Inventory.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAcquireScript(null)
            .withOverflowScript(null)
            .withConsumeScript(null)
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new Gs2Inventory.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 inventory

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

try:
    result = client.create_namespace(
        inventory.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_acquire_script(None)
            .with_overflow_script(None)
            .with_consume_script(None)
            .with_simple_item_acquire_script(None)
            .with_simple_item_consume_script(None)
            .with_big_item_acquire_script(None)
            .with_big_item_consume_script(None)
            .with_log_setting(
                inventory.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('inventory')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    acquireScript=nil,
    overflowScript=nil,
    consumeScript=nil,
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=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('inventory')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    acquireScript=nil,
    overflowScript=nil,
    consumeScript=nil,
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=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/inventory"
import "github.com/openlyinc/pointy"

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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


```

**GS2-Script**
```lua

client = gs2('inventory')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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


```

**GS2-Script**
```lua

client = gs2('inventory')

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

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>
표준, 심플, 빅 아이템에 대한 아이템 획득, 오버플로 처리, 소비의 GS2-Script 트리거를 변경할 수 있습니다.<br>
스크립트 설정 변경은 이후 작업에 즉시 반영됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | 트랜잭션 설정<br>아이템 획득 및 소비 등의 인벤토리 조작에 대한 분산 트랜잭션 처리를 설정합니다. 원활한 실행을 위한 자동 실행 모드, 여러 리소스에 대한 일관된 조작을 위한 원자적 커밋(atomic commit), 대규모 보상 배포를 위한 비동기 처리를 지원합니다. |
| acquireScript | [ScriptSetting](#scriptsetting) |  | |  |  | 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`acquire`](../script/#acquire) |
| overflowScript | [ScriptSetting](#scriptsetting) |  | |  |  | 입수 상한에 도달하여 입수할 수 없었을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`overflowDone`](../script/#overflowdone) |
| consumeScript | [ScriptSetting](#scriptsetting) |  | |  |  | 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`consume`](../script/#consume) |
| simpleItemAcquireScript | [ScriptSetting](#scriptsetting) |  | |  |  | 심플 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`simpleItemAcquire`](../script/#simpleitemacquire) |
| simpleItemConsumeScript | [ScriptSetting](#scriptsetting) |  | |  |  | 심플 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`simpleItemConsume`](../script/#simpleitemconsume) |
| bigItemAcquireScript | [ScriptSetting](#scriptsetting) |  | |  |  | 거대 아이템을 입수했을 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`bigItemAcquire`](../script/#bigitemacquire) |
| bigItemConsumeScript | [ScriptSetting](#scriptsetting) |  | |  |  | 거대 아이템을 소비할 때 실행할 스크립트 설정<br>Script 트리거 레퍼런스 - [`bigItemConsume`](../script/#bigitemconsume) |
| 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/inventory"
import "github.com/openlyinc/pointy"

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &inventory.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        AcquireScript: &inventory.ScriptSetting{
            TriggerScriptId: pointy.String("script-1001"),
            DoneTriggerScriptId: pointy.String("script-1002"),
            DoneTriggerQueueNamespaceId: pointy.String("namespace-1001"),
        },
        OverflowScript: &inventory.ScriptSetting{
            DoneTriggerScriptId: pointy.String("script-1003"),
            DoneTriggerQueueNamespaceId: pointy.String("script-1004"),
        },
        ConsumeScript: &inventory.ScriptSetting{
            TriggerScriptId: pointy.String("script-1005"),
            DoneTriggerScriptId: pointy.String("script-1006"),
            DoneTriggerQueueNamespaceId: pointy.String("namespace-1001"),
        },
        SimpleItemAcquireScript: nil,
        SimpleItemConsumeScript: nil,
        BigItemAcquireScript: nil,
        BigItemConsumeScript: nil,
        LogSetting: &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withAcquireScript((new \Gs2\Inventory\Model\ScriptSetting())
                ->withTriggerScriptId("script-1001")
                ->withDoneTriggerScriptId("script-1002")
                ->withDoneTriggerQueueNamespaceId("namespace-1001"))
            ->withOverflowScript((new \Gs2\Inventory\Model\ScriptSetting())
                ->withDoneTriggerScriptId("script-1003")
                ->withDoneTriggerQueueNamespaceId("script-1004"))
            ->withConsumeScript((new \Gs2\Inventory\Model\ScriptSetting())
                ->withTriggerScriptId("script-1005")
                ->withDoneTriggerScriptId("script-1006")
                ->withDoneTriggerQueueNamespaceId("namespace-1001"))
            ->withSimpleItemAcquireScript(null)
            ->withSimpleItemConsumeScript(null)
            ->withBigItemAcquireScript(null)
            ->withBigItemConsumeScript(null)
            ->withLogSetting((new \Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateNamespaceRequest;
import io.gs2.inventory.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAcquireScript(new io.gs2.inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1001")
                .withDoneTriggerScriptId("script-1002")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withOverflowScript(new io.gs2.inventory.model.ScriptSetting()
                .withDoneTriggerScriptId("script-1003")
                .withDoneTriggerQueueNamespaceId("script-1004"))
            .withConsumeScript(new io.gs2.inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1005")
                .withDoneTriggerScriptId("script-1006")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new io.gs2.inventory.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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Inventory.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithAcquireScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
            .WithTriggerScriptId("script-1001")
            .WithDoneTriggerScriptId("script-1002")
            .WithDoneTriggerQueueNamespaceId("namespace-1001"))
        .WithOverflowScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
            .WithDoneTriggerScriptId("script-1003")
            .WithDoneTriggerQueueNamespaceId("script-1004"))
        .WithConsumeScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
            .WithTriggerScriptId("script-1005")
            .WithDoneTriggerScriptId("script-1006")
            .WithDoneTriggerQueueNamespaceId("namespace-1001"))
        .WithSimpleItemAcquireScript(null)
        .WithSimpleItemConsumeScript(null)
        .WithBigItemAcquireScript(null)
        .WithBigItemConsumeScript(null)
        .WithLogSetting(new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.updateNamespace(
        new Gs2Inventory.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAcquireScript(new Gs2Inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1001")
                .withDoneTriggerScriptId("script-1002")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withOverflowScript(new Gs2Inventory.model.ScriptSetting()
                .withDoneTriggerScriptId("script-1003")
                .withDoneTriggerQueueNamespaceId("script-1004"))
            .withConsumeScript(new Gs2Inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1005")
                .withDoneTriggerScriptId("script-1006")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new Gs2Inventory.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 inventory

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

try:
    result = client.update_namespace(
        inventory.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_acquire_script(
                inventory.ScriptSetting()
                    .with_trigger_script_id('script-1001')
                    .with_done_trigger_script_id('script-1002')
                    .with_done_trigger_queue_namespace_id('namespace-1001'))
            .with_overflow_script(
                inventory.ScriptSetting()
                    .with_done_trigger_script_id('script-1003')
                    .with_done_trigger_queue_namespace_id('script-1004'))
            .with_consume_script(
                inventory.ScriptSetting()
                    .with_trigger_script_id('script-1005')
                    .with_done_trigger_script_id('script-1006')
                    .with_done_trigger_queue_namespace_id('namespace-1001'))
            .with_simple_item_acquire_script(None)
            .with_simple_item_consume_script(None)
            .with_big_item_acquire_script(None)
            .with_big_item_consume_script(None)
            .with_log_setting(
                inventory.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('inventory')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    acquireScript={
        triggerScriptId="script-1001",
        doneTriggerScriptId="script-1002",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    overflowScript={
        doneTriggerScriptId="script-1003",
        doneTriggerQueueNamespaceId="script-1004",
    },
    consumeScript={
        triggerScriptId="script-1005",
        doneTriggerScriptId="script-1006",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=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('inventory')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    acquireScript={
        triggerScriptId="script-1001",
        doneTriggerScriptId="script-1002",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    overflowScript={
        doneTriggerScriptId="script-1003",
        doneTriggerQueueNamespaceId="script-1004",
    },
    consumeScript={
        triggerScriptId="script-1005",
        doneTriggerScriptId="script-1006",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=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/inventory"
import "github.com/openlyinc/pointy"

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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


```

**GS2-Script**
```lua

client = gs2('inventory')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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


```

**GS2-Script**
```lua

client = gs2('inventory')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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


```

**GS2-Script**
```lua

client = gs2('inventory')

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

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와 연결된 데이터의 덤프가 완료되었는지 확인<br>

이전에 시작된 사용자 데이터 덤프 작업의 진행 상황을 확인합니다.<br>
덤프에는 사용자가 소유한 모든 인벤토리 데이터, 아이템 세트, 심플 아이템, 빅 아이템이 포함됩니다.<br>
완료 시 익스포트된 데이터를 다운로드할 수 있는 URL을 반환합니다.


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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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


```

**GS2-Script**
```lua

client = gs2('inventory')

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

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의 사용자 데이터 완전 삭제가 완료되었는지 확인<br>

이전에 시작된 사용자 데이터 클리닝 작업의 진행 상황을 확인합니다.<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/inventory"
import "github.com/openlyinc/pointy"

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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


```

**GS2-Script**
```lua

client = gs2('inventory')

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

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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

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

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

$session->open();

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

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

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

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

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

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

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와 연결된 데이터의 임포트가 완료되었는지 확인<br>

이전에 시작된 사용자 데이터 임포트 작업의 진행 상황을 확인합니다.<br>
임포트를 통해 이전에 익스포트된 데이터로부터 인벤토리 데이터, 아이템 세트, 심플 아이템, 빅 아이템이 복원됩니다.<br>
완료 시 임포트 로그를 다운로드할 수 있는 URL을 반환합니다.


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

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

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

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

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

$session->open();

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

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

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

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

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

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

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

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

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;

```



---

### describeInventories

인벤토리 목록 취득<br>

요청한 사용자의 인벤토리 페이지네이션 목록을 취득합니다.<br>
각 인벤토리는 특정 인벤토리 모델에 대한 현재 용량(아이템 슬롯 수)을 추적합니다.<br>
인벤토리는 사용자가 처음으로 아이템을 입수했을 때 자동으로 생성되며, 초기 용량은 인벤토리 모델의 initialCapacity 로 설정됩니다.


#### Request

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

#### Result

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

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeInventories(
    &inventory.DescribeInventoriesRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoriesRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeInventories(
        (new DescribeInventoriesRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoriesRequest;
import io.gs2.inventory.result.DescribeInventoriesResult;

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

try {
    DescribeInventoriesResult result = client.describeInventories(
        new DescribeInventoriesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Inventory> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoriesResult> asyncResult = null;
yield return client.DescribeInventories(
    new Gs2.Gs2Inventory.Request.DescribeInventoriesRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeInventories(
        new Gs2Inventory.DescribeInventoriesRequest()
            .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 inventory

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

try:
    result = client.describe_inventories(
        inventory.DescribeInventoriesRequest()
            .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('inventory')

api_result = client.describe_inventories({
    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('inventory')

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

```



---

### describeInventoriesByUserId

사용자 ID를 지정하여 인벤토리 목록을 취득<br>

지정된 사용자의 인벤토리 페이지네이션 목록을 취득합니다.<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;Inventory&gt;](#inventory) | 인벤토리 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeInventoriesByUserId(
    &inventory.DescribeInventoriesByUserIdRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoriesByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeInventoriesByUserId(
        (new DescribeInventoriesByUserIdRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoriesByUserIdRequest;
import io.gs2.inventory.result.DescribeInventoriesByUserIdResult;

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

try {
    DescribeInventoriesByUserIdResult result = client.describeInventoriesByUserId(
        new DescribeInventoriesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Inventory> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoriesByUserIdResult> asyncResult = null;
yield return client.DescribeInventoriesByUserId(
    new Gs2.Gs2Inventory.Request.DescribeInventoriesByUserIdRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeInventoriesByUserId(
        new Gs2Inventory.DescribeInventoriesByUserIdRequest()
            .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 inventory

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

try:
    result = client.describe_inventories_by_user_id(
        inventory.DescribeInventoriesByUserIdRequest()
            .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('inventory')

api_result = client.describe_inventories_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('inventory')

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

```



---

### getInventory

인벤토리를 취득<br>

지정된 인벤토리 모델에 대한 요청 사용자의 인벤토리(현재 용량 포함)를 취득합니다.<br>
이 인벤토리에서 아이템을 한 번도 입수한 적이 없는 경우, 데이터는 반환되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetInventory(
    &inventory.GetInventoryRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getInventory(
        (new GetInventoryRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryRequest;
import io.gs2.inventory.result.GetInventoryResult;

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

try {
    GetInventoryResult result = client.getInventory(
        new GetInventoryRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
    );
    Inventory 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryResult> asyncResult = null;
yield return client.GetInventory(
    new Gs2.Gs2Inventory.Request.GetInventoryRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getInventory(
        new Gs2Inventory.GetInventoryRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_inventory(
        inventory.GetInventoryRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_inventory({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.get_inventory_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
})

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

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

result = api_result.result
item = result.item;

```



---

### getInventoryByUserId

사용자 ID를 지정하여 인벤토리를 취득<br>

지정된 인벤토리 모델에 대한 사용자의 인벤토리(현재 용량 포함)를 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetInventoryByUserId(
    &inventory.GetInventoryByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getInventoryByUserId(
        (new GetInventoryByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryByUserIdRequest;
import io.gs2.inventory.result.GetInventoryByUserIdResult;

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

try {
    GetInventoryByUserIdResult result = client.getInventoryByUserId(
        new GetInventoryByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Inventory 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryByUserIdResult> asyncResult = null;
yield return client.GetInventoryByUserId(
    new Gs2.Gs2Inventory.Request.GetInventoryByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getInventoryByUserId(
        new Gs2Inventory.GetInventoryByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_inventory_by_user_id(
        inventory.GetInventoryByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_inventory_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.get_inventory_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### addCapacityByUserId

사용자 ID를 지정하여 인벤토리의 용량 크기를 가산<br>

지정된 양만큼 사용자의 인벤토리 용량을 증가시킵니다.<br>
결과 용량은 인벤토리 모델의 maxCapacity 를 초과할 수 없습니다.<br>
인벤토리가 아직 존재하지 않는 경우, initialCapacity 로 자동 생성된 후 지정된 값이 가산됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| addCapacityValue | int |  | ✓|  | 1 ~ 2147483646 | 가산할 용량 크기 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Inventory](#inventory) | 용량 가산 후의 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.AddCapacityByUserId(
    &inventory.AddCapacityByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        AddCapacityValue: pointy.Int32(1),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AddCapacityByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->addCapacityByUserId(
        (new AddCapacityByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withAddCapacityValue(1)
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AddCapacityByUserIdRequest;
import io.gs2.inventory.result.AddCapacityByUserIdResult;

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

try {
    AddCapacityByUserIdResult result = client.addCapacityByUserId(
        new AddCapacityByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withAddCapacityValue(1)
            .withTimeOffsetToken(null)
    );
    Inventory 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AddCapacityByUserIdResult> asyncResult = null;
yield return client.AddCapacityByUserId(
    new Gs2.Gs2Inventory.Request.AddCapacityByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithAddCapacityValue(1)
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.addCapacityByUserId(
        new Gs2Inventory.AddCapacityByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withAddCapacityValue(1)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.add_capacity_by_user_id(
        inventory.AddCapacityByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_add_capacity_value(1)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.add_capacity_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    addCapacityValue=1,
    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('inventory')

api_result_handler = client.add_capacity_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    addCapacityValue=1,
    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;

```



---

### setCapacityByUserId

사용자 ID를 지정하여 인벤토리의 용량 크기를 설정<br>

사용자의 인벤토리 용량을 지정된 절대값으로 설정합니다.<br>
갱신 전후의 인벤토리 상태를 모두 반환하므로, 신구 용량 값을 비교할 수 있습니다.<br>
새로운 용량 값은 인벤토리 모델의 maxCapacity 를 초과할 수 없습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| newCapacityValue | int |  | ✓|  | 1 ~ 2147483646 | 인벤토리의 새로운 최대 용량 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Inventory](#inventory) | 갱신 후 인벤토리 |
| old | [Inventory](#inventory) | 갱신 전 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.SetCapacityByUserId(
    &inventory.SetCapacityByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        NewCapacityValue: pointy.Int32(10),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\SetCapacityByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->setCapacityByUserId(
        (new SetCapacityByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withNewCapacityValue(10)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.SetCapacityByUserIdRequest;
import io.gs2.inventory.result.SetCapacityByUserIdResult;

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

try {
    SetCapacityByUserIdResult result = client.setCapacityByUserId(
        new SetCapacityByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withNewCapacityValue(10)
            .withTimeOffsetToken(null)
    );
    Inventory item = result.getItem();
    Inventory old = result.getOld();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.SetCapacityByUserIdResult> asyncResult = null;
yield return client.SetCapacityByUserId(
    new Gs2.Gs2Inventory.Request.SetCapacityByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithNewCapacityValue(10)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.setCapacityByUserId(
        new Gs2Inventory.SetCapacityByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withNewCapacityValue(10)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.set_capacity_by_user_id(
        inventory.SetCapacityByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_new_capacity_value(10)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.set_capacity_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    newCapacityValue=10,
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('inventory')

api_result_handler = client.set_capacity_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    newCapacityValue=10,
    timeOffsetToken=nil,
})

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

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

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

```



---

### deleteInventoryByUserId

인벤토리를 삭제<br>

지정된 사용자의 인벤토리와 이에 관련된 모든 아이템 세트를 삭제합니다.<br>
이 작업은 인벤토리와 그 안에 저장된 모든 아이템을 영구적으로 삭제합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteInventoryByUserId(
    &inventory.DeleteInventoryByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteInventoryByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteInventoryByUserId(
        (new DeleteInventoryByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteInventoryByUserIdRequest;
import io.gs2.inventory.result.DeleteInventoryByUserIdResult;

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

try {
    DeleteInventoryByUserIdResult result = client.deleteInventoryByUserId(
        new DeleteInventoryByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Inventory 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteInventoryByUserIdResult> asyncResult = null;
yield return client.DeleteInventoryByUserId(
    new Gs2.Gs2Inventory.Request.DeleteInventoryByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.deleteInventoryByUserId(
        new Gs2Inventory.DeleteInventoryByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.delete_inventory_by_user_id(
        inventory.DeleteInventoryByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_inventory_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.delete_inventory_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyInventoryCurrentMaxCapacity

현재 인벤토리의 최대 용량을 검증<br>

사용자의 현재 최대 인벤토리 용량이 지정된 조건을 만족하는지 검증합니다.<br>
6개의 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.<br>
검증에는 저장된 원시 값이 아닌, 버프 적용 후의 용량 값(GS2-Buff 의 활성 버프 효과를 반영)이 사용됩니다.<br>
조건이 충족되지 않으면 오류가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 현재 인벤토리의 최대 용량이 지정 값 미만일 것 / lessEqual: 현재 인벤토리의 최대 용량이 지정 값 이하일 것 / greater: 현재 인벤토리의 최대 용량이 지정 값 초과일 것 / greaterEqual: 현재 인벤토리의 최대 용량이 지정 값 이상일 것 / equal: 현재 인벤토리의 최대 용량이 지정 값과 일치할 것 / notEqual: 현재 인벤토리의 최대 용량이 지정 값과 일치하지 않을 것 /  |
| currentInventoryMaxCapacity | int |  | ✓|  | 0 ~ 2147483646 | 현재 인벤토리의 최대 용량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyInventoryCurrentMaxCapacity(
    &inventory.VerifyInventoryCurrentMaxCapacityRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        InventoryName: pointy.String("inventory-0001"),
        VerifyType: pointy.String("less"),
        CurrentInventoryMaxCapacity: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyInventoryCurrentMaxCapacityRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyInventoryCurrentMaxCapacity(
        (new VerifyInventoryCurrentMaxCapacityRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withInventoryName("inventory-0001")
            ->withVerifyType("less")
            ->withCurrentInventoryMaxCapacity(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyInventoryCurrentMaxCapacityRequest;
import io.gs2.inventory.result.VerifyInventoryCurrentMaxCapacityResult;

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

try {
    VerifyInventoryCurrentMaxCapacityResult result = client.verifyInventoryCurrentMaxCapacity(
        new VerifyInventoryCurrentMaxCapacityRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Inventory 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityResult> asyncResult = null;
yield return client.VerifyInventoryCurrentMaxCapacity(
    new Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithInventoryName("inventory-0001")
        .WithVerifyType("less")
        .WithCurrentInventoryMaxCapacity(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyInventoryCurrentMaxCapacity(
        new Gs2Inventory.VerifyInventoryCurrentMaxCapacityRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_inventory_current_max_capacity(
        inventory.VerifyInventoryCurrentMaxCapacityRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_inventory_name('inventory-0001')
            .with_verify_type('less')
            .with_current_inventory_max_capacity(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_inventory_current_max_capacity({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    verifyType="less",
    currentInventoryMaxCapacity=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.verify_inventory_current_max_capacity_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    verifyType="less",
    currentInventoryMaxCapacity=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyInventoryCurrentMaxCapacityByUserId

사용자 ID를 지정하여 인벤토리의 최대 용량을 검증<br>

지정된 사용자의 현재 최대 인벤토리 용량이 지정된 조건을 만족하는지 검증합니다.<br>
6개의 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.<br>
검증에는 버프 적용 후의 용량 값(GS2-Buff 의 활성 버프 효과를 반영)이 사용됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>이 인벤토리의 구조와 용량 설정을 정의하는 인벤토리 모델의 이름입니다. 사용자의 인벤토리 인스턴스를 모델 정의에 연결하여 사용 가능한 아이템의 종류와 용량 제한을 결정합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 현재 인벤토리의 최대 용량이 지정 값 미만일 것 / lessEqual: 현재 인벤토리의 최대 용량이 지정 값 이하일 것 / greater: 현재 인벤토리의 최대 용량이 지정 값 초과일 것 / greaterEqual: 현재 인벤토리의 최대 용량이 지정 값 이상일 것 / equal: 현재 인벤토리의 최대 용량이 지정 값과 일치할 것 / notEqual: 현재 인벤토리의 최대 용량이 지정 값과 일치하지 않을 것 /  |
| currentInventoryMaxCapacity | int |  | ✓|  | 0 ~ 2147483646 | 현재 인벤토리의 최대 용량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyInventoryCurrentMaxCapacityByUserId(
    &inventory.VerifyInventoryCurrentMaxCapacityByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        InventoryName: pointy.String("inventory-0001"),
        VerifyType: pointy.String("less"),
        CurrentInventoryMaxCapacity: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyInventoryCurrentMaxCapacityByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyInventoryCurrentMaxCapacityByUserId(
        (new VerifyInventoryCurrentMaxCapacityByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withVerifyType("less")
            ->withCurrentInventoryMaxCapacity(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyInventoryCurrentMaxCapacityByUserIdRequest;
import io.gs2.inventory.result.VerifyInventoryCurrentMaxCapacityByUserIdResult;

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

try {
    VerifyInventoryCurrentMaxCapacityByUserIdResult result = client.verifyInventoryCurrentMaxCapacityByUserId(
        new VerifyInventoryCurrentMaxCapacityByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Inventory 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityByUserIdResult> asyncResult = null;
yield return client.VerifyInventoryCurrentMaxCapacityByUserId(
    new Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithVerifyType("less")
        .WithCurrentInventoryMaxCapacity(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyInventoryCurrentMaxCapacityByUserId(
        new Gs2Inventory.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_inventory_current_max_capacity_by_user_id(
        inventory.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_inventory_name('inventory-0001')
            .with_verify_type('less')
            .with_current_inventory_max_capacity(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_inventory_current_max_capacity_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    verifyType="less",
    currentInventoryMaxCapacity=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.verify_inventory_current_max_capacity_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    verifyType="less",
    currentInventoryMaxCapacity=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### describeItemSets

아이템 세트 목록 취득<br>

지정된 인벤토리 내 요청 사용자의 아이템 세트에 대한 페이지네이션이 적용된 리스트를 취득합니다.<br>
각 아이템 세트는 특정 수량, 옵션의 유효기간, 옵션의 참조를 가진 아이템 스택을 나타냅니다.<br>
아이템 모델이 복수 스택을 허용하는 경우, 동일한 아이템 종류가 서로 다른 수량과 유효기간을 가진 여러 아이템 세트 항목으로 표시됩니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 아이템 세트 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeItemSets(
    &inventory.DescribeItemSetsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemSetsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeItemSets(
        (new DescribeItemSetsRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemSetsRequest;
import io.gs2.inventory.result.DescribeItemSetsResult;

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

try {
    DescribeItemSetsResult result = client.describeItemSets(
        new DescribeItemSetsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ItemSet> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemSetsResult> asyncResult = null;
yield return client.DescribeItemSets(
    new Gs2.Gs2Inventory.Request.DescribeItemSetsRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeItemSets(
        new Gs2Inventory.DescribeItemSetsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .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 inventory

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

try:
    result = client.describe_item_sets(
        inventory.DescribeItemSetsRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .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('inventory')

api_result = client.describe_item_sets({
    namespaceName="namespace-0001",
    inventoryName="item",
    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('inventory')

api_result_handler = client.describe_item_sets_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    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;

```



---

### describeItemSetsByUserId

사용자 ID를 지정하여 아이템 세트 목록 취득<br>

지정된 인벤토리 내 사용자의 아이템 세트에 대한 페이지네이션이 적용된 리스트를 취득합니다.<br>
각 아이템 세트는 특정 수량, 옵션의 유효기간, 옵션의 참조를 가진 아이템 스택을 나타냅니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 아이템 세트 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeItemSetsByUserId(
    &inventory.DescribeItemSetsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemSetsByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeItemSetsByUserId(
        (new DescribeItemSetsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemSetsByUserIdRequest;
import io.gs2.inventory.result.DescribeItemSetsByUserIdResult;

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

try {
    DescribeItemSetsByUserIdResult result = client.describeItemSetsByUserId(
        new DescribeItemSetsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<ItemSet> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemSetsByUserIdResult> asyncResult = null;
yield return client.DescribeItemSetsByUserId(
    new Gs2.Gs2Inventory.Request.DescribeItemSetsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeItemSetsByUserId(
        new Gs2Inventory.DescribeItemSetsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-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 inventory

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

try:
    result = client.describe_item_sets_by_user_id(
        inventory.DescribeItemSetsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-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('inventory')

api_result = client.describe_item_sets_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-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('inventory')

api_result_handler = client.describe_item_sets_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-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;

```



---

### getItemSet

아이템 세트 취득<br>

요청 사용자의 인벤토리 내 지정된 아이템의 아이템 세트를 취득합니다.<br>
옵션인 itemSetName으로 특정 스택으로 필터링할 수 있습니다. 지정하지 않으면 해당 아이템의 모든 스택이 반환됩니다.<br>
관련된 아이템 모델과 인벤토리 정보도 함께 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetItemSet(
    &inventory.GetItemSetRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("itemSet-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemSetRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getItemSet(
        (new GetItemSetRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withItemSetName("itemSet-0001")
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemSetRequest;
import io.gs2.inventory.result.GetItemSetResult;

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

try {
    GetItemSetResult result = client.getItemSet(
        new GetItemSetRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("itemSet-0001")
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetItemSetResult> asyncResult = null;
yield return client.GetItemSet(
    new Gs2.Gs2Inventory.Request.GetItemSetRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithItemSetName("itemSet-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getItemSet(
        new Gs2Inventory.GetItemSetRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("itemSet-0001")
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_item_set(
        inventory.GetItemSetRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_item_set_name('itemSet-0001')
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_item_set({
    namespaceName="namespace-0001",
    inventoryName="item",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="itemSet-0001",
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.get_item_set_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="itemSet-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;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### getItemSetByUserId

사용자 ID를 지정하여 아이템 세트 취득<br>

지정된 사용자의 인벤토리 내 특정 아이템의 아이템 세트를 취득합니다.<br>
옵션인 itemSetName으로 특정 스택으로 필터링할 수 있습니다. 지정하지 않으면 해당 아이템의 모든 스택이 반환됩니다.<br>
관련된 아이템 모델과 인벤토리 정보도 함께 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetItemSetByUserId(
    &inventory.GetItemSetByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getItemSetByUserId(
        (new GetItemSetByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemSetByUserIdRequest;
import io.gs2.inventory.result.GetItemSetByUserIdResult;

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

try {
    GetItemSetByUserIdResult result = client.getItemSetByUserId(
        new GetItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withTimeOffsetToken(null)
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetItemSetByUserIdResult> asyncResult = null;
yield return client.GetItemSetByUserId(
    new Gs2.Gs2Inventory.Request.GetItemSetByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getItemSetByUserId(
        new Gs2Inventory.GetItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_item_set_by_user_id(
        inventory.GetItemSetByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name(None)
            .with_time_offset_token(None)
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_item_set_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName=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;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.get_item_set_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName=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;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### getItemWithSignature

서명과 함께 아이템 세트 취득<br>

데이터의 진위를 검증하는 데 사용할 수 있는 암호 서명과 함께 아이템 세트를 취득합니다.<br>
서명은 지정된 암호 키를 사용하여 생성되며, 외부 시스템이 아이템 데이터가 변조되지 않았음을 검증할 수 있습니다.<br>
아이템 소지 여부를 제3자가 검증해야 하는 서버 권위적 검증 시나리오에 유용합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024자 | 암호화 키 GRN |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |
| body | string | 서명 대상의 아이템 세트 정보 |
| signature | string | 서명 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetItemWithSignature(
    &inventory.GetItemWithSignatureRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: nil,
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemWithSignatureRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getItemWithSignature(
        (new GetItemWithSignatureRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withItemSetName(null)
            ->withKeyId("key-0001")
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemWithSignatureRequest;
import io.gs2.inventory.result.GetItemWithSignatureResult;

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

try {
    GetItemWithSignatureResult result = client.getItemWithSignature(
        new GetItemWithSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("key-0001")
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
    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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemWithSignatureResult> asyncResult = null;
yield return client.GetItemWithSignature(
    new Gs2.Gs2Inventory.Request.GetItemWithSignatureRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithItemSetName(null)
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getItemWithSignature(
        new Gs2Inventory.GetItemWithSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("key-0001")
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_item_with_signature(
        inventory.GetItemWithSignatureRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_item_set_name(None)
            .with_key_id('key-0001')
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_item_with_signature({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName=nil,
    keyId="key-0001",
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;

```

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

client = gs2('inventory')

api_result_handler = client.get_item_with_signature_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName=nil,
    keyId="key-0001",
})

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

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;

```



---

### getItemWithSignatureByUserId

사용자 ID를 지정하여 서명이 포함된 아이템 세트 취득<br>

지정된 사용자의 암호 서명이 포함된 아이템 세트를 취득합니다.<br>
서명은 외부의 진위 검증을 위해 지정된 암호 키를 사용하여 생성됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024자 | 암호화 키 GRN |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |
| body | string | 서명 대상의 아이템 세트 정보 |
| signature | string | 서명 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetItemWithSignatureByUserId(
    &inventory.GetItemWithSignatureByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: nil,
        KeyId: pointy.String("key-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemWithSignatureByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getItemWithSignatureByUserId(
        (new GetItemWithSignatureByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName(null)
            ->withKeyId("key-0001")
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemWithSignatureByUserIdRequest;
import io.gs2.inventory.result.GetItemWithSignatureByUserIdResult;

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

try {
    GetItemWithSignatureByUserIdResult result = client.getItemWithSignatureByUserId(
        new GetItemWithSignatureByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
    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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetItemWithSignatureByUserId(
    new Gs2.Gs2Inventory.Request.GetItemWithSignatureByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName(null)
        .WithKeyId("key-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getItemWithSignatureByUserId(
        new Gs2Inventory.GetItemWithSignatureByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_item_with_signature_by_user_id(
        inventory.GetItemWithSignatureByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name(None)
            .with_key_id('key-0001')
            .with_time_offset_token(None)
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_item_with_signature_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName=nil,
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;

```

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

client = gs2('inventory')

api_result_handler = client.get_item_with_signature_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName=nil,
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;

```



---

### acquireItemSetByUserId

사용자 ID를 지정하여 아이템 세트 입수<br>

사용자의 인벤토리에 아이템을 추가합니다. 기존 아이템 세트에 여유(스택 제한 미만)가 있는 경우 그곳에 추가되며, 그렇지 않은 경우 복수 스택이 허용되어 있으면 새로운 아이템 세트가 생성됩니다.<br>
선택적으로 expiresAt을 지정하여 새로 생성되는 아이템 세트의 유효기간을 설정할 수 있습니다. 유효기간이 이미 지난 아이템은 빈 것으로 취급됩니다.<br>
createNewItemSet이 true인 경우, 기존 세트에 여유가 있어도 항상 새로운 아이템 세트가 생성됩니다.<br>
합계 수량이 인벤토리 용량을 초과하는 경우 오버플로우 수량이 반환되며, 네임스페이스 설정에 따라 오버플로우분이 GS2-Inbox로 전송될 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| acquireCount | long |  | ✓|  | 1 ~ 9223372036854775805 | 입수하는 양 |
| expiresAt | long |  | | 0 |  | 유효기간<br>UNIX 시간·밀리초 |
| createNewItemSet | bool |  | | false |  | 기존 아이템 세트에 여유가 있더라도 새로운 아이템 세트를 생성할지 여부 |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 가산 후 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |
| overflowCount | long | 소지 수량 상한을 초과하여 받지 못하고 GS2-Inbox로 전송한 아이템의 수량 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.AcquireItemSetByUserId(
    &inventory.AcquireItemSetByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-0001"),
        UserId: pointy.String("user-0001"),
        AcquireCount: pointy.Int64(5),
        ExpiresAt: pointy.Int64(0),
        CreateNewItemSet: nil,
        ItemSetName: pointy.String("itemSet-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
overflowCount := result.OverflowCount

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->acquireItemSetByUserId(
        (new AcquireItemSetByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-0001")
            ->withUserId("user-0001")
            ->withAcquireCount(5)
            ->withExpiresAt(0)
            ->withCreateNewItemSet(null)
            ->withItemSetName("itemSet-0001")
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
    $overflowCount = $result->getOverflowCount();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireItemSetByUserIdRequest;
import io.gs2.inventory.result.AcquireItemSetByUserIdResult;

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

try {
    AcquireItemSetByUserIdResult result = client.acquireItemSetByUserId(
        new AcquireItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-0001")
            .withUserId("user-0001")
            .withAcquireCount(5L)
            .withExpiresAt(0L)
            .withCreateNewItemSet(null)
            .withItemSetName("itemSet-0001")
            .withTimeOffsetToken(null)
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
    long overflowCount = result.getOverflowCount();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.AcquireItemSetByUserIdResult> asyncResult = null;
yield return client.AcquireItemSetByUserId(
    new Gs2.Gs2Inventory.Request.AcquireItemSetByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-0001")
        .WithUserId("user-0001")
        .WithAcquireCount(5L)
        .WithExpiresAt(0L)
        .WithCreateNewItemSet(null)
        .WithItemSetName("itemSet-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var overflowCount = result.OverflowCount;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.acquireItemSetByUserId(
        new Gs2Inventory.AcquireItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-0001")
            .withUserId("user-0001")
            .withAcquireCount(5)
            .withExpiresAt(0)
            .withCreateNewItemSet(null)
            .withItemSetName("itemSet-0001")
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
    const overflowCount = result.getOverflowCount();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.acquire_item_set_by_user_id(
        inventory.AcquireItemSetByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-0001')
            .with_user_id('user-0001')
            .with_acquire_count(5)
            .with_expires_at(0)
            .with_create_new_item_set(None)
            .with_item_set_name('itemSet-0001')
            .with_time_offset_token(None)
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
    overflow_count = result.overflow_count
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.acquire_item_set_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-0001",
    userId="user-0001",
    acquireCount=5,
    expiresAt=0,
    createNewItemSet=nil,
    itemSetName="itemSet-0001",
    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;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;

```

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

client = gs2('inventory')

api_result_handler = client.acquire_item_set_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-0001",
    userId="user-0001",
    acquireCount=5,
    expiresAt=0,
    createNewItemSet=nil,
    itemSetName="itemSet-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
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;

```



---

### acquireItemSetWithGradeByUserId

사용자 ID를 지정하여 GS2-Grade에 그레이드를 설정하면서 아이템 세트를 1개 입수<br>

아이템을 1개 입수함과 동시에 GS2-Grade를 통해 그레이드 값을 설정합니다.<br>
각 아이템이 서로 다른 그레이드 값을 가지는 품질/랭크 시스템(예: 스탯이 다른 장비)을 가진 아이템에 사용됩니다.<br>
항상 새로운 아이템 세트가 생성되며(createNewItemSet의 동작), 아이템 입수 후 GS2-Grade의 SetGradeByUserId를 통해 그레이드가 설정됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| gradeModelId | string |  | ✓|  |  ~ 1024자 | 그레이드 모델 GRN |
| gradeValue | long |  | ✓|  | 1 ~ 9223372036854775805 | 설정할 그레이드 값 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [ItemSet](#itemset) | 가산 후 아이템 세트 |
| status | [Status](../../grade/sdk/#status) | 설정한 그레이드 스테이터스 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |
| overflowCount | long | 소지 수량 상한을 초과하여 받지 못하고 GS2-Inbox로 전송한 아이템의 수량 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.AcquireItemSetWithGradeByUserId(
    &inventory.AcquireItemSetWithGradeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        UserId: pointy.String("user-0001"),
        GradeModelId: pointy.String("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001"),
        GradeValue: pointy.Int64(1),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
status := result.Status
itemModel := result.ItemModel
inventory := result.Inventory
overflowCount := result.OverflowCount

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireItemSetWithGradeByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->acquireItemSetWithGradeByUserId(
        (new AcquireItemSetWithGradeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withUserId("user-0001")
            ->withGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
            ->withGradeValue(1)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $status = $result->getStatus();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
    $overflowCount = $result->getOverflowCount();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireItemSetWithGradeByUserIdRequest;
import io.gs2.inventory.result.AcquireItemSetWithGradeByUserIdResult;

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

try {
    AcquireItemSetWithGradeByUserIdResult result = client.acquireItemSetWithGradeByUserId(
        new AcquireItemSetWithGradeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withUserId("user-0001")
            .withGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
            .withGradeValue(1L)
            .withTimeOffsetToken(null)
    );
    ItemSet item = result.getItem();
    Status status = result.getStatus();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
    long overflowCount = result.getOverflowCount();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.AcquireItemSetWithGradeByUserIdResult> asyncResult = null;
yield return client.AcquireItemSetWithGradeByUserId(
    new Gs2.Gs2Inventory.Request.AcquireItemSetWithGradeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithUserId("user-0001")
        .WithGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
        .WithGradeValue(1L)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var status = result.Status;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var overflowCount = result.OverflowCount;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.acquireItemSetWithGradeByUserId(
        new Gs2Inventory.AcquireItemSetWithGradeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withUserId("user-0001")
            .withGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
            .withGradeValue(1)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const status = result.getStatus();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
    const overflowCount = result.getOverflowCount();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.acquire_item_set_with_grade_by_user_id(
        inventory.AcquireItemSetWithGradeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_user_id('user-0001')
            .with_grade_model_id('grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001')
            .with_grade_value(1)
            .with_time_offset_token(None)
    )
    item = result.item
    status = result.status
    item_model = result.item_model
    inventory = result.inventory
    overflow_count = result.overflow_count
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.acquire_item_set_with_grade_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    userId="user-0001",
    gradeModelId="grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001",
    gradeValue=1,
    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;
status = result.status;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;

```

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

client = gs2('inventory')

api_result_handler = client.acquire_item_set_with_grade_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    userId="user-0001",
    gradeModelId="grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001",
    gradeValue=1,
    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;
status = result.status;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;

```



---

### consumeItemSet

아이템 세트를 소비<br>

요청 사용자의 인벤토리 내 지정된 아이템의 수량을 감소시킵니다.<br>
itemSetName을 지정하면 해당 특정 스택만 소비 대상이 됩니다. 지정하지 않으면 해당 아이템 타입의 모든 스택에서 소비됩니다.<br>
아이템 세트의 수량이 0이 되면 자동으로 삭제됩니다.<br>
요청된 양을 소비하기에 충분한 아이템이 없는 경우 Insufficient 에러가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| consumeCount | long |  | ✓|  | 1 ~ 9223372036854775805 | 소비 수량 |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 소비 후 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ConsumeItemSet(
    &inventory.ConsumeItemSetRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ConsumeCount: pointy.Int64(1),
        ItemSetName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeItemSetRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->consumeItemSet(
        (new ConsumeItemSetRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withConsumeCount(1)
            ->withItemSetName(null)
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeItemSetRequest;
import io.gs2.inventory.result.ConsumeItemSetResult;

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

try {
    ConsumeItemSetResult result = client.consumeItemSet(
        new ConsumeItemSetRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withConsumeCount(1L)
            .withItemSetName(null)
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeItemSetResult> asyncResult = null;
yield return client.ConsumeItemSet(
    new Gs2.Gs2Inventory.Request.ConsumeItemSetRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithConsumeCount(1L)
        .WithItemSetName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.consumeItemSet(
        new Gs2Inventory.ConsumeItemSetRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withConsumeCount(1)
            .withItemSetName(null)
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.consume_item_set(
        inventory.ConsumeItemSetRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_consume_count(1)
            .with_item_set_name(None)
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.consume_item_set({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    consumeCount=1,
    itemSetName=nil,
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.consume_item_set_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    consumeCount=1,
    itemSetName=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;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### consumeItemSetByUserId

사용자 ID를 지정하여 아이템 세트를 소비<br>

지정된 사용자의 인벤토리 내 특정 아이템의 수량을 감소시킵니다.<br>
itemSetName을 지정하면 해당 특정 스택만 소비 대상이 됩니다. 지정하지 않으면 해당 아이템 타입의 모든 스택에서 소비됩니다.<br>
아이템 세트의 수량이 0이 되면 자동으로 삭제됩니다.<br>
충분한 아이템이 없는 경우 Insufficient 에러가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| consumeCount | long |  | ✓|  | 1 ~ 9223372036854775805 | 소비 수량 |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 소비 후 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ConsumeItemSetByUserId(
    &inventory.ConsumeItemSetByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ConsumeCount: pointy.Int64(1),
        ItemSetName: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->consumeItemSetByUserId(
        (new ConsumeItemSetByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withConsumeCount(1)
            ->withItemSetName(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeItemSetByUserIdRequest;
import io.gs2.inventory.result.ConsumeItemSetByUserIdResult;

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

try {
    ConsumeItemSetByUserIdResult result = client.consumeItemSetByUserId(
        new ConsumeItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withConsumeCount(1L)
            .withItemSetName(null)
            .withTimeOffsetToken(null)
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeItemSetByUserIdResult> asyncResult = null;
yield return client.ConsumeItemSetByUserId(
    new Gs2.Gs2Inventory.Request.ConsumeItemSetByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithConsumeCount(1L)
        .WithItemSetName(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.consumeItemSetByUserId(
        new Gs2Inventory.ConsumeItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withConsumeCount(1)
            .withItemSetName(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.consume_item_set_by_user_id(
        inventory.ConsumeItemSetByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_consume_count(1)
            .with_item_set_name(None)
            .with_time_offset_token(None)
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.consume_item_set_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    consumeCount=1,
    itemSetName=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;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.consume_item_set_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    consumeCount=1,
    itemSetName=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;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### deleteItemSetByUserId

아이템 세트를 삭제<br>

지정된 아이템을 사용자의 인벤토리에서 영구적으로 삭제합니다.<br>
itemSetName을 지정하면 해당 특정 스택만 삭제됩니다. 지정하지 않으면 해당 아이템 타입의 모든 스택이 삭제됩니다.<br>
소비와 달리 이 작업은 특정 수량을 필요로 하지 않으며, 수량과 관계없이 아이템 세트 전체를 삭제합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 삭제한 아이템 세트 리스트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteItemSetByUserId(
    &inventory.DeleteItemSetByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("itemSet-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteItemSetByUserId(
        (new DeleteItemSetByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName("itemSet-0001")
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteItemSetByUserIdRequest;
import io.gs2.inventory.result.DeleteItemSetByUserIdResult;

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

try {
    DeleteItemSetByUserIdResult result = client.deleteItemSetByUserId(
        new DeleteItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("itemSet-0001")
            .withTimeOffsetToken(null)
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.DeleteItemSetByUserIdResult> asyncResult = null;
yield return client.DeleteItemSetByUserId(
    new Gs2.Gs2Inventory.Request.DeleteItemSetByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName("itemSet-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.deleteItemSetByUserId(
        new Gs2Inventory.DeleteItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("itemSet-0001")
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.delete_item_set_by_user_id(
        inventory.DeleteItemSetByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name('itemSet-0001')
            .with_time_offset_token(None)
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_item_set_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="itemSet-0001",
    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;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.delete_item_set_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="itemSet-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
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### verifyItemSet

아이템 세트의 소지 수량 검증<br>

요청 사용자의 합계 아이템 수량이 지정된 조건을 만족하는지 검증합니다.<br>
수량은 지정된 아이템 타입의 모든 아이템 세트를 합산하여 계산됩니다.<br>
6가지 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.<br>
조건이 만족되지 않는 경우 반전된 조건명으로 에러가 반환됩니다(예: "less" 검사 실패 시 "greaterEqual" 에러를 반환합니다).


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 소지 수량이 지정 값 미만일 것 / lessEqual: 소지 수량이 지정 값 이하일 것 / greater: 소지 수량이 지정 값 초과일 것 / greaterEqual: 소지 수량이 지정 값 이상일 것 / equal: 소지 수량이 지정 값과 일치할 것 / notEqual: 소지 수량이 지정 값과 일치하지 않을 것 /  |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| count | long |  | ✓|  | 0 ~ 9223372036854775805 | 소지 수량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 삭제한 아이템 세트 리스트 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyItemSet(
    &inventory.VerifyItemSetRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        ItemSetName: nil,
        Count: pointy.Int64(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyItemSetRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyItemSet(
        (new VerifyItemSetRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withItemSetName(null)
            ->withCount(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyItemSetRequest;
import io.gs2.inventory.result.VerifyItemSetResult;

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

try {
    VerifyItemSetResult result = client.verifyItemSet(
        new VerifyItemSetRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    List<ItemSet> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyItemSetResult> asyncResult = null;
yield return client.VerifyItemSet(
    new Gs2.Gs2Inventory.Request.VerifyItemSetRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithItemSetName(null)
        .WithCount(10L)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyItemSet(
        new Gs2Inventory.VerifyItemSetRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_item_set(
        inventory.VerifyItemSetRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_item_set_name(None)
            .with_count(10)
            .with_multiply_value_specifying_quantity(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_item_set({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    itemSetName=nil,
    count=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
items = result.items;

```

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

client = gs2('inventory')

api_result_handler = client.verify_item_set_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    itemSetName=nil,
    count=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
items = result.items;

```



---

### verifyItemSetByUserId

사용자 ID를 지정하여 아이템 세트의 소지 수량 검증<br>

지정된 사용자의 합계 아이템 수량이 지정된 조건을 만족하는지 검증합니다.<br>
수량은 지정된 아이템 타입의 모든 아이템 세트를 합산하여 계산됩니다.<br>
6가지 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델 이름<br>인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 소지 수량이 지정 값 미만일 것 / lessEqual: 소지 수량이 지정 값 이하일 것 / greater: 소지 수량이 지정 값 초과일 것 / greaterEqual: 소지 수량이 지정 값 이상일 것 / equal: 소지 수량이 지정 값과 일치할 것 / notEqual: 소지 수량이 지정 값과 일치하지 않을 것 /  |
| itemSetName | string |  | |  |  ~ 36자 | 아이템 세트를 식별하는 이름 |
| count | long |  | ✓|  | 0 ~ 9223372036854775805 | 소지 수량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemSet&gt;](#itemset) | 삭제한 아이템 세트 리스트 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyItemSetByUserId(
    &inventory.VerifyItemSetByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        ItemSetName: nil,
        Count: pointy.Int64(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyItemSetByUserId(
        (new VerifyItemSetByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withItemSetName(null)
            ->withCount(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyItemSetByUserIdRequest;
import io.gs2.inventory.result.VerifyItemSetByUserIdResult;

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

try {
    VerifyItemSetByUserIdResult result = client.verifyItemSetByUserId(
        new VerifyItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    List<ItemSet> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyItemSetByUserIdResult> asyncResult = null;
yield return client.VerifyItemSetByUserId(
    new Gs2.Gs2Inventory.Request.VerifyItemSetByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithItemSetName(null)
        .WithCount(10L)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyItemSetByUserId(
        new Gs2Inventory.VerifyItemSetByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_item_set_by_user_id(
        inventory.VerifyItemSetByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_item_set_name(None)
            .with_count(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_item_set_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    itemSetName=nil,
    count=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;

```

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

client = gs2('inventory')

api_result_handler = client.verify_item_set_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    itemSetName=nil,
    count=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
items = result.items;

```



---

### describeReferenceOf

참조원 목록을 취득<br>

요청 사용자의 특정 아이템 세트에 등록되어 있는 참조원 문자열 목록을 취득합니다.<br>
참조원은 아이템 세트를 외부 엔티티(장비 슬롯 등)에 연관 짓기 위해 사용되며, 인벤토리 모델에서 protectReferencedItem 이 활성화된 경우, 참조원을 가진 아이템은 소비·삭제할 수 없게 됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | List&lt;string&gt; | 이 소지품의 참조원 목록 |
| itemSet | [ItemSet](#itemset) | 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeReferenceOf(
    &inventory.DescribeReferenceOfRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeReferenceOfRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeReferenceOf(
        (new DescribeReferenceOfRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
    );
    $items = $result->getItems();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeReferenceOfRequest;
import io.gs2.inventory.result.DescribeReferenceOfResult;

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

try {
    DescribeReferenceOfResult result = client.describeReferenceOf(
        new DescribeReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
    );
    List<String> items = result.getItems();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.DescribeReferenceOfResult> asyncResult = null;
yield return client.DescribeReferenceOf(
    new Gs2.Gs2Inventory.Request.DescribeReferenceOfRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeReferenceOf(
        new Gs2Inventory.DescribeReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
    );
    const items = result.getItems();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.describe_reference_of(
        inventory.DescribeReferenceOfRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
    )
    items = result.items
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_reference_of({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
})

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

result = api_result.result
items = result.items;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.describe_reference_of_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### describeReferenceOfByUserId

사용자 ID를 지정하여 참조원 목록을 취득<br>

지정된 사용자의 특정 아이템 세트에 등록되어 있는 참조원 문자열 목록을 취득합니다.<br>
참조원은 아이템 세트를 외부 엔티티(장비 슬롯 등)에 연관 짓기 위해 사용되며, 인벤토리 모델에서 protectReferencedItem 이 활성화된 경우, 참조원을 가진 아이템은 소비·삭제할 수 없게 됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | List&lt;string&gt; | 이 소지품의 참조원 목록 |
| itemSet | [ItemSet](#itemset) | 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeReferenceOfByUserId(
    &inventory.DescribeReferenceOfByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeReferenceOfByUserId(
        (new DescribeReferenceOfByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeReferenceOfByUserIdRequest;
import io.gs2.inventory.result.DescribeReferenceOfByUserIdResult;

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

try {
    DescribeReferenceOfByUserIdResult result = client.describeReferenceOfByUserId(
        new DescribeReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withTimeOffsetToken(null)
    );
    List<String> items = result.getItems();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.DescribeReferenceOfByUserIdResult> asyncResult = null;
yield return client.DescribeReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.DescribeReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeReferenceOfByUserId(
        new Gs2Inventory.DescribeReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.describe_reference_of_by_user_id(
        inventory.DescribeReferenceOfByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_time_offset_token(None)
    )
    items = result.items
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_reference_of_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.describe_reference_of_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-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
items = result.items;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### getReferenceOf

참조원을 취득<br>

요청 사용자의 아이템 세트에 등록되어 있는 특정 참조원 문자열을 취득합니다.<br>
관련된 아이템 세트, 아이템 모델, 인벤토리 데이터도 함께 반환합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetReferenceOf(
    &inventory.GetReferenceOfRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: ['resource-0001'],
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetReferenceOfRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getReferenceOf(
        (new GetReferenceOfRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf(['resource-0001'])
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetReferenceOfRequest;
import io.gs2.inventory.result.GetReferenceOfResult;

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

try {
    GetReferenceOfResult result = client.getReferenceOf(
        new GetReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetReferenceOfResult> asyncResult = null;
yield return client.GetReferenceOf(
    new Gs2.Gs2Inventory.Request.GetReferenceOfRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf(['resource-0001']),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getReferenceOf(
        new Gs2Inventory.GetReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_reference_of(
        inventory.GetReferenceOfRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of(['resource-0001'])
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_reference_of({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-0001'],
})

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

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.get_reference_of_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### getReferenceOfByUserId

사용자 ID를 지정하여 참조원을 취득<br>

지정된 사용자의 아이템 세트에 등록되어 있는 특정 참조원 문자열을 취득합니다.<br>
관련된 아이템 세트, 아이템 모델, 인벤토리 데이터도 함께 반환합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetReferenceOfByUserId(
    &inventory.GetReferenceOfByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: ['resource-0001'],
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getReferenceOfByUserId(
        (new GetReferenceOfByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf(['resource-0001'])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetReferenceOfByUserIdRequest;
import io.gs2.inventory.result.GetReferenceOfByUserIdResult;

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

try {
    GetReferenceOfByUserIdResult result = client.getReferenceOfByUserId(
        new GetReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
            .withTimeOffsetToken(null)
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetReferenceOfByUserIdResult> asyncResult = null;
yield return client.GetReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.GetReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf(['resource-0001'])
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getReferenceOfByUserId(
        new Gs2Inventory.GetReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_reference_of_by_user_id(
        inventory.GetReferenceOfByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of(['resource-0001'])
            .with_time_offset_token(None)
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_reference_of_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.get_reference_of_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### verifyReferenceOf

아이템의 참조원을 검증<br>

요청 사용자의 아이템 세트 상의 참조원 상태를 검증합니다.<br>
4개의 검증 타입을 지원: not_entry(참조원이 미등록), already_entry(참조원이 등록됨), empty(참조원이 0개), not_empty(참조원이 1개 이상 존재).<br>
조건이 충족되지 않으면 오류가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |
| verifyType | 문자열 열거형<br>enum {<br>"not_entry",<br>"already_entry",<br>"empty",<br>"not_empty"<br>}<br> |  | ✓|  |  | 검증 종류not_entry: 지정한 참조원이 아직 등록되어 있지 않을 것 / already_entry: 지정한 참조원이 이미 등록되어 있을 것 / empty: 참조원으로 등록되어 있는 요소가 0개일 것 / not_empty: 참조원으로 등록되어 있는 요소가 1개 이상일 것 /  |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyReferenceOf(
    &inventory.VerifyReferenceOfRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: pointy.String("resource-0001"),
        VerifyType: pointy.String("not_entry"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyReferenceOfRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyReferenceOf(
        (new VerifyReferenceOfRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf("resource-0001")
            ->withVerifyType("not_entry")
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyReferenceOfRequest;
import io.gs2.inventory.result.VerifyReferenceOfResult;

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

try {
    VerifyReferenceOfResult result = client.verifyReferenceOf(
        new VerifyReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withVerifyType("not_entry")
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.VerifyReferenceOfResult> asyncResult = null;
yield return client.VerifyReferenceOf(
    new Gs2.Gs2Inventory.Request.VerifyReferenceOfRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf("resource-0001")
        .WithVerifyType("not_entry"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyReferenceOf(
        new Gs2Inventory.VerifyReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withVerifyType("not_entry")
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_reference_of(
        inventory.VerifyReferenceOfRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of('resource-0001')
            .with_verify_type('not_entry')
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_reference_of({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-0001",
    verifyType="not_entry",
})

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

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.verify_reference_of_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-0001",
    verifyType="not_entry",
})

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

```



---

### verifyReferenceOfByUserId

사용자 ID를 지정하여 아이템의 참조원을 검증<br>

지정된 사용자의 아이템 세트 상의 참조원 상태를 검증합니다.<br>
4개의 검증 타입을 지원: not_entry(참조원이 미등록), already_entry(참조원이 등록됨), empty(참조원이 0개), not_empty(참조원이 1개 이상 존재).<br>
조건이 충족되지 않으면 오류가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |
| verifyType | 문자열 열거형<br>enum {<br>"not_entry",<br>"already_entry",<br>"empty",<br>"not_empty"<br>}<br> |  | ✓|  |  | 검증 종류not_entry: 지정한 참조원이 아직 등록되어 있지 않을 것 / already_entry: 지정한 참조원이 이미 등록되어 있을 것 / empty: 참조원으로 등록되어 있는 요소가 0개일 것 / not_empty: 참조원으로 등록되어 있는 요소가 1개 이상일 것 /  |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyReferenceOfByUserId(
    &inventory.VerifyReferenceOfByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: pointy.String("resource-0001"),
        VerifyType: pointy.String("not_entry"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyReferenceOfByUserId(
        (new VerifyReferenceOfByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf("resource-0001")
            ->withVerifyType("not_entry")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyReferenceOfByUserIdRequest;
import io.gs2.inventory.result.VerifyReferenceOfByUserIdResult;

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

try {
    VerifyReferenceOfByUserIdResult result = client.verifyReferenceOfByUserId(
        new VerifyReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withVerifyType("not_entry")
            .withTimeOffsetToken(null)
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.VerifyReferenceOfByUserIdResult> asyncResult = null;
yield return client.VerifyReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.VerifyReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf("resource-0001")
        .WithVerifyType("not_entry")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyReferenceOfByUserId(
        new Gs2Inventory.VerifyReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withVerifyType("not_entry")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_reference_of_by_user_id(
        inventory.VerifyReferenceOfByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of('resource-0001')
            .with_verify_type('not_entry')
            .with_time_offset_token(None)
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_reference_of_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-0001",
    verifyType="not_entry",
    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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.verify_reference_of_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-0001",
    verifyType="not_entry",
    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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### addReferenceOf

참조원을 추가<br>

요청 사용자의 지정된 아이템 세트에 참조원 문자열을 등록합니다.<br>
참조원은 아이템 세트를 외부 엔티티(장비 슬롯이나 캐릭터 등)에 연관 짓습니다.<br>
인벤토리 모델에서 protectReferencedItem 이 활성화된 경우, 참조원을 가진 아이템은 소비·삭제할 수 없게 되어, 장비 중인 아이템이 실수로 소비되는 것을 방지할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 참조원 추가 후의 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.AddReferenceOf(
    &inventory.AddReferenceOfRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: ['resource-0001'],
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AddReferenceOfRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->addReferenceOf(
        (new AddReferenceOfRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf(['resource-0001'])
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AddReferenceOfRequest;
import io.gs2.inventory.result.AddReferenceOfResult;

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

try {
    AddReferenceOfResult result = client.addReferenceOf(
        new AddReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.AddReferenceOfResult> asyncResult = null;
yield return client.AddReferenceOf(
    new Gs2.Gs2Inventory.Request.AddReferenceOfRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf(['resource-0001']),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.addReferenceOf(
        new Gs2Inventory.AddReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.add_reference_of(
        inventory.AddReferenceOfRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of(['resource-0001'])
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.add_reference_of({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-0001'],
})

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

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.add_reference_of_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### addReferenceOfByUserId

사용자 ID를 지정하여 아이템에 참조원을 추가<br>

지정된 사용자의 지정된 아이템 세트에 참조원 문자열을 등록합니다.<br>
참조원은 아이템 세트를 외부 엔티티(장비 슬롯이나 캐릭터 등)에 연관 짓습니다.<br>
인벤토리 모델에서 protectReferencedItem 이 활성화된 경우, 참조원을 가진 아이템은 소비·삭제할 수 없게 되어, 장비 중인 아이템이 실수로 소비되는 것을 방지할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 참조원 추가 후의 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.AddReferenceOfByUserId(
    &inventory.AddReferenceOfByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: ['resource-0001'],
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AddReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->addReferenceOfByUserId(
        (new AddReferenceOfByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf(['resource-0001'])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AddReferenceOfByUserIdRequest;
import io.gs2.inventory.result.AddReferenceOfByUserIdResult;

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

try {
    AddReferenceOfByUserIdResult result = client.addReferenceOfByUserId(
        new AddReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
            .withTimeOffsetToken(null)
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.AddReferenceOfByUserIdResult> asyncResult = null;
yield return client.AddReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.AddReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf(['resource-0001'])
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.addReferenceOfByUserId(
        new Gs2Inventory.AddReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.add_reference_of_by_user_id(
        inventory.AddReferenceOfByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of(['resource-0001'])
            .with_time_offset_token(None)
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.add_reference_of_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.add_reference_of_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### deleteReferenceOf

참조원을 삭제<br>

요청 사용자의 지정된 아이템 세트에서 특정 참조원 문자열을 삭제합니다.<br>
삭제 후, protectReferencedItem 이 활성화되어 있고 다른 참조원이 남아있지 않은 경우, 아이템은 다시 소비·삭제가 가능해집니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 참조원 삭제 후의 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteReferenceOf(
    &inventory.DeleteReferenceOfRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: pointy.String("resource-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteReferenceOfRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteReferenceOf(
        (new DeleteReferenceOfRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf("resource-0001")
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteReferenceOfRequest;
import io.gs2.inventory.result.DeleteReferenceOfResult;

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

try {
    DeleteReferenceOfResult result = client.deleteReferenceOf(
        new DeleteReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.DeleteReferenceOfResult> asyncResult = null;
yield return client.DeleteReferenceOf(
    new Gs2.Gs2Inventory.Request.DeleteReferenceOfRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf("resource-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.deleteReferenceOf(
        new Gs2Inventory.DeleteReferenceOfRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.delete_reference_of(
        inventory.DeleteReferenceOfRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of('resource-0001')
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_reference_of({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-0001",
})

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

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.delete_reference_of_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### deleteReferenceOfByUserId

사용자 ID를 지정하여 아이템의 참조원을 삭제<br>

지정된 사용자의 지정된 아이템 세트에서 특정 참조원 문자열을 삭제합니다.<br>
삭제 후, protectReferencedItem 이 활성화되어 있고 다른 참조원이 남아있지 않은 경우, 아이템은 다시 소비·삭제가 가능해집니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템 세트를 포함하는 인벤토리 모델의 이름입니다. itemName과 함께 사용되어 이 소지품이 어떤 인벤토리와 아이템 종류에 속하는지를 식별하는 데 사용됩니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>이 세트에 저장된 아이템의 종류를 정의하는 아이템 모델의 이름입니다. inventoryName과 조합하여 이 아이템 세트의 스택 상한과 다중 스택 동작을 결정합니다. |
| itemSetName | string |  | ✓| UUID |  ~ 36자 | 아이템 세트를 식별하는 이름<br>아이템 세트의 고유한 이름을 보유합니다.<br>이름은 UUID(Universally Unique Identifier) 형식으로 자동 생성되며, 각 아이템 세트를 식별하는 데 사용됩니다. |
| referenceOf | string |  | ✓|  |  ~ 1024자 | 참조원<br>장비 슬롯이나 편성 바인드 등, 이 아이템 세트에 대한 외부 참조를 나타내는 문자열 식별자입니다. 인벤토리 모델에서 protectReferencedItem이 활성화된 경우, 참조원을 가진 아이템 세트는 소비하거나 삭제할 수 없습니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | string | 이 소지품의 참조원 |
| itemSet | [ItemSet](#itemset) | 참조원 삭제 후의 아이템 세트 |
| itemModel | [ItemModel](#itemmodel) | 아이템 모델 |
| inventory | [Inventory](#inventory) | 인벤토리 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteReferenceOfByUserId(
    &inventory.DeleteReferenceOfByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("item-set-0001"),
        ReferenceOf: pointy.String("resource-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteReferenceOfByUserId(
        (new DeleteReferenceOfByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName("item-set-0001")
            ->withReferenceOf("resource-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteReferenceOfByUserIdRequest;
import io.gs2.inventory.result.DeleteReferenceOfByUserIdResult;

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

try {
    DeleteReferenceOfByUserIdResult result = client.deleteReferenceOfByUserId(
        new DeleteReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withTimeOffsetToken(null)
    );
    String item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.DeleteReferenceOfByUserIdResult> asyncResult = null;
yield return client.DeleteReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.DeleteReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName("item-set-0001")
        .WithReferenceOf("resource-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.deleteReferenceOfByUserId(
        new Gs2Inventory.DeleteReferenceOfByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.delete_reference_of_by_user_id(
        inventory.DeleteReferenceOfByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name('item-set-0001')
            .with_reference_of('resource-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_reference_of_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```

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

client = gs2('inventory')

api_result_handler = client.delete_reference_of_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    itemSetName="item-set-0001",
    referenceOf="resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

```



---

### describeSimpleItems

심플 아이템 목록 조회<br>

지정된 심플 인벤토리 내에서 요청 사용자의 심플 아이템의 페이지네이션된 목록을 조회합니다.<br>
각 심플 아이템은 스택, 유효기간, 참조를 갖지 않으며, 아이템 타입별로 단일 수량 값을 추적합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItem&gt;](#simpleitem) | 심플 아이템 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeSimpleItems(
    &inventory.DescribeSimpleItemsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeSimpleItems(
        (new DescribeSimpleItemsRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemsRequest;
import io.gs2.inventory.result.DescribeSimpleItemsResult;

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

try {
    DescribeSimpleItemsResult result = client.describeSimpleItems(
        new DescribeSimpleItemsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SimpleItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemsResult> asyncResult = null;
yield return client.DescribeSimpleItems(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemsRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeSimpleItems(
        new Gs2Inventory.DescribeSimpleItemsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .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 inventory

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

try:
    result = client.describe_simple_items(
        inventory.DescribeSimpleItemsRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .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('inventory')

api_result = client.describe_simple_items({
    namespaceName="namespace-0001",
    inventoryName="item",
    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('inventory')

api_result_handler = client.describe_simple_items_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    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;

```



---

### describeSimpleItemsByUserId

사용자 ID를 지정하여 심플 아이템 목록 조회<br>

지정된 심플 인벤토리 내에서 사용자의 심플 아이템의 페이지네이션된 목록을 조회합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItem&gt;](#simpleitem) | 심플 아이템 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeSimpleItemsByUserId(
    &inventory.DescribeSimpleItemsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemsByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeSimpleItemsByUserId(
        (new DescribeSimpleItemsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.DescribeSimpleItemsByUserIdResult;

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

try {
    DescribeSimpleItemsByUserIdResult result = client.describeSimpleItemsByUserId(
        new DescribeSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SimpleItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemsByUserIdResult> asyncResult = null;
yield return client.DescribeSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeSimpleItemsByUserId(
        new Gs2Inventory.DescribeSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-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 inventory

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

try:
    result = client.describe_simple_items_by_user_id(
        inventory.DescribeSimpleItemsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-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('inventory')

api_result = client.describe_simple_items_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-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('inventory')

api_result_handler = client.describe_simple_items_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-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;

```



---

### getSimpleItem

심플 아이템 조회<br>

지정된 이름의 요청 사용자의 심플 아이템(현재 수량과 관련된 아이템 모델 포함)을 조회합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItem](#simpleitem) | 심플 아이템 |
| itemModel | [SimpleItemModel](#simpleitemmodel) | 심플 아이템 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleItem(
    &inventory.GetSimpleItemRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleItem(
        (new GetSimpleItemRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
    );
    $item = $result->getItem();
    $itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemRequest;
import io.gs2.inventory.result.GetSimpleItemResult;

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

try {
    GetSimpleItemResult result = client.getSimpleItem(
        new GetSimpleItemRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
    );
    SimpleItem item = result.getItem();
    SimpleItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemResult> asyncResult = null;
yield return client.GetSimpleItem(
    new Gs2.Gs2Inventory.Request.GetSimpleItemRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getSimpleItem(
        new Gs2Inventory.GetSimpleItemRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
    );
    const item = result.getItem();
    const itemModel = result.getItemModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_simple_item(
        inventory.GetSimpleItemRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
    )
    item = result.item
    item_model = result.item_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_item({
    namespaceName="namespace-0001",
    inventoryName="item",
    accessToken="accessToken-0001",
    itemName="item-0001",
})

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

result = api_result.result
item = result.item;
itemModel = result.itemModel;

```

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

client = gs2('inventory')

api_result_handler = client.get_simple_item_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    accessToken="accessToken-0001",
    itemName="item-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;
itemModel = result.itemModel;

```



---

### getSimpleItemByUserId

사용자 ID를 지정하여 심플 아이템 조회<br>

지정된 사용자의 특정 이름의 심플 아이템(현재 수량과 관련된 아이템 모델 포함)을 조회합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItem](#simpleitem) | 심플 아이템 |
| itemModel | [SimpleItemModel](#simpleitemmodel) | 심플 아이템 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleItemByUserId(
    &inventory.GetSimpleItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleItemByUserId(
        (new GetSimpleItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemByUserIdRequest;
import io.gs2.inventory.result.GetSimpleItemByUserIdResult;

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

try {
    GetSimpleItemByUserIdResult result = client.getSimpleItemByUserId(
        new GetSimpleItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withTimeOffsetToken(null)
    );
    SimpleItem item = result.getItem();
    SimpleItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemByUserIdResult> asyncResult = null;
yield return client.GetSimpleItemByUserId(
    new Gs2.Gs2Inventory.Request.GetSimpleItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getSimpleItemByUserId(
        new Gs2Inventory.GetSimpleItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const itemModel = result.getItemModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_simple_item_by_user_id(
        inventory.GetSimpleItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    item_model = result.item_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_item_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-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;
itemModel = result.itemModel;

```

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

client = gs2('inventory')

api_result_handler = client.get_simple_item_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-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;
itemModel = result.itemModel;

```



---

### getSimpleItemWithSignature

서명과 함께 심플 아이템 조회<br>

진위 검증을 위한 암호 서명과 함께 심플 아이템을 조회합니다.<br>
서명은 지정된 암호 키를 사용하여 생성되며, 외부 시스템이 아이템 데이터를 검증할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024자 | 암호화 키 GRN |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItem](#simpleitem) | 심플 아이템 |
| simpleItemModel | [SimpleItemModel](#simpleitemmodel) | 심플 아이템 모델 |
| body | string | 서명 대상 심플 아이템 정보 |
| signature | string | 서명 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleItemWithSignature(
    &inventory.GetSimpleItemWithSignatureRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
simpleItemModel := result.SimpleItemModel
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemWithSignatureRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleItemWithSignature(
        (new GetSimpleItemWithSignatureRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withKeyId("key-0001")
    );
    $item = $result->getItem();
    $simpleItemModel = $result->getSimpleItemModel();
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemWithSignatureRequest;
import io.gs2.inventory.result.GetSimpleItemWithSignatureResult;

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

try {
    GetSimpleItemWithSignatureResult result = client.getSimpleItemWithSignature(
        new GetSimpleItemWithSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withKeyId("key-0001")
    );
    SimpleItem item = result.getItem();
    SimpleItemModel simpleItemModel = result.getSimpleItemModel();
    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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureResult> asyncResult = null;
yield return client.GetSimpleItemWithSignature(
    new Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var simpleItemModel = result.SimpleItemModel;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getSimpleItemWithSignature(
        new Gs2Inventory.GetSimpleItemWithSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const simpleItemModel = result.getSimpleItemModel();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_simple_item_with_signature(
        inventory.GetSimpleItemWithSignatureRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_key_id('key-0001')
    )
    item = result.item
    simple_item_model = result.simple_item_model
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_item_with_signature({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    keyId="key-0001",
})

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

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

```

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

client = gs2('inventory')

api_result_handler = client.get_simple_item_with_signature_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    keyId="key-0001",
})

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

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

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

```



---

### getSimpleItemWithSignatureByUserId

사용자 ID를 지정하여 서명이 포함된 심플 아이템 조회<br>

외부의 진위 검증을 위한 암호 서명과 함께 지정된 사용자의 심플 아이템을 조회합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| keyId | string |  | | "grn:gs2:{region}:{ownerId}:key:default:key:default" |  ~ 1024자 | 암호화 키 GRN |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItem](#simpleitem) | 심플 아이템 |
| simpleItemModel | [SimpleItemModel](#simpleitemmodel) | 심플 아이템 모델 |
| body | string | 서명 대상 심플 아이템 정보 |
| signature | string | 서명 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleItemWithSignatureByUserId(
    &inventory.GetSimpleItemWithSignatureByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        KeyId: pointy.String("key-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
simpleItemModel := result.SimpleItemModel
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemWithSignatureByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleItemWithSignatureByUserId(
        (new GetSimpleItemWithSignatureByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withKeyId("key-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $simpleItemModel = $result->getSimpleItemModel();
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemWithSignatureByUserIdRequest;
import io.gs2.inventory.result.GetSimpleItemWithSignatureByUserIdResult;

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

try {
    GetSimpleItemWithSignatureByUserIdResult result = client.getSimpleItemWithSignatureByUserId(
        new GetSimpleItemWithSignatureByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    SimpleItem item = result.getItem();
    SimpleItemModel simpleItemModel = result.getSimpleItemModel();
    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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetSimpleItemWithSignatureByUserId(
    new Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithKeyId("key-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var simpleItemModel = result.SimpleItemModel;
var body = result.Body;
var signature = result.Signature;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getSimpleItemWithSignatureByUserId(
        new Gs2Inventory.GetSimpleItemWithSignatureByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const simpleItemModel = result.getSimpleItemModel();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_simple_item_with_signature_by_user_id(
        inventory.GetSimpleItemWithSignatureByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_key_id('key-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    simple_item_model = result.simple_item_model
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_item_with_signature_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

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

```

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

client = gs2('inventory')

api_result_handler = client.get_simple_item_with_signature_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

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

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

```



---

### acquireSimpleItemsByUserId

사용자 ID를 지정하여 심플 아이템 입수<br>

입수 수량의 배치를 사용하여 사용자의 심플 인벤토리에 아이템을 추가합니다.<br>
단일 원자적 작업으로 여러 아이템을 입수할 수 있습니다. acquireCounts 배열로 각 아이템의 이름과 수량을 지정합니다.<br>
일반적인 아이템 세트와 달리, 심플 아이템에는 용량 제한, 스택 제한, 유효기간이 없습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| acquireCounts | [List&lt;AcquireCount&gt;](#acquirecount) |  | ✓|  | 1 ~ 100 items | 심플 아이템의 입수 수량 리스트 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItem&gt;](#simpleitem) | 가산 후 심플 아이템 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.AcquireSimpleItemsByUserId(
    &inventory.AcquireSimpleItemsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        AcquireCounts: []inventory.AcquireCount{
            inventory.AcquireCount{
                ItemName: pointy.String("item-0001"),
                Count: pointy.Int64(5),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireSimpleItemsByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->acquireSimpleItemsByUserId(
        (new AcquireSimpleItemsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withAcquireCounts([
                (new \Gs2\Inventory\Model\AcquireCount())
                    ->withItemName("item-0001")
                    ->withCount(5),
            ])
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.AcquireSimpleItemsByUserIdResult;

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

try {
    AcquireSimpleItemsByUserIdResult result = client.acquireSimpleItemsByUserId(
        new AcquireSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withAcquireCounts(Arrays.asList(
                new io.gs2.inventory.model.AcquireCount()
                    .withItemName("item-0001")
                    .withCount(5L)
            ))
            .withTimeOffsetToken(null)
    );
    List<SimpleItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireSimpleItemsByUserIdResult> asyncResult = null;
yield return client.AcquireSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.AcquireSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithAcquireCounts(new Gs2.Gs2Inventory.Model.AcquireCount[] {
            new Gs2.Gs2Inventory.Model.AcquireCount()
                .WithItemName("item-0001")
                .WithCount(5L),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.acquireSimpleItemsByUserId(
        new Gs2Inventory.AcquireSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withAcquireCounts([
                new Gs2Inventory.model.AcquireCount()
                    .withItemName("item-0001")
                    .withCount(5),
            ])
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.acquire_simple_items_by_user_id(
        inventory.AcquireSimpleItemsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_acquire_counts([
                inventory.AcquireCount()
                    .with_item_name('item-0001')
                    .with_count(5),
            ])
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.acquire_simple_items_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    acquireCounts={
        {
            itemName="item-0001",
            count=5,
        }
    },
    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;

```

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

client = gs2('inventory')

api_result_handler = client.acquire_simple_items_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    acquireCounts={
        {
            itemName="item-0001",
            count=5,
        }
    },
    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;

```



---

### consumeSimpleItems

심플 아이템 소비<br>

소비 수량의 배치를 사용하여 요청 사용자의 심플 인벤토리 내 아이템 수량을 감소시킵니다.<br>
단일 원자적 작업으로 여러 아이템을 소비할 수 있습니다. 어느 하나의 아이템 수량이라도 부족한 경우, 작업 전체가 실패합니다.<br>
지정된 아이템 중 하나라도 충분하지 않은 경우, Insufficient 오류가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| consumeCounts | [List&lt;ConsumeCount&gt;](#consumecount) |  | ✓|  | 1 ~ 100 items | 심플 아이템의 소비 수량 리스트 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItem&gt;](#simpleitem) | 소비 후 심플 아이템 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ConsumeSimpleItems(
    &inventory.ConsumeSimpleItemsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ConsumeCounts: []inventory.ConsumeCount{
            inventory.ConsumeCount{
                ItemName: pointy.String("item-0001"),
                Count: pointy.Int64(5),
            },
            inventory.ConsumeCount{
                ItemName: pointy.String("item-0002"),
                Count: pointy.Int64(3),
            },
        },
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeSimpleItemsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->consumeSimpleItems(
        (new ConsumeSimpleItemsRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withConsumeCounts([
                (new ConsumeCount())
                    ->withItemName("item-0001")
                    ->withCount(5),
                (new ConsumeCount())
                    ->withItemName("item-0002")
                    ->withCount(3),
            ])
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeSimpleItemsRequest;
import io.gs2.inventory.result.ConsumeSimpleItemsResult;

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

try {
    ConsumeSimpleItemsResult result = client.consumeSimpleItems(
        new ConsumeSimpleItemsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withConsumeCounts(Arrays.asList(
                new ConsumeCount()
                    .withItemName("item-0001")
                    .withCount(5L),
                new ConsumeCount()
                    .withItemName("item-0002")
                    .withCount(3L)
            ))
    );
    List<SimpleItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeSimpleItemsResult> asyncResult = null;
yield return client.ConsumeSimpleItems(
    new Gs2.Gs2Inventory.Request.ConsumeSimpleItemsRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithConsumeCounts(new Gs2.Gs2Inventory.Model.ConsumeCount[] {
            new Gs2.Gs2Inventory.Model.ConsumeCount()
                .WithItemName("item-0001")
                .WithCount(5L),
            new Gs2.Gs2Inventory.Model.ConsumeCount()
                .WithItemName("item-0002")
                .WithCount(3L),
        }),
    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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.consumeSimpleItems(
        new Gs2Inventory.ConsumeSimpleItemsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withConsumeCounts([
                new Gs2Inventory.model.ConsumeCount()
                    .withItemName("item-0001")
                    .withCount(5),
                new Gs2Inventory.model.ConsumeCount()
                    .withItemName("item-0002")
                    .withCount(3),
            ])
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.consume_simple_items(
        inventory.ConsumeSimpleItemsRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_consume_counts([
                inventory.ConsumeCount()
                    .with_item_name('item-0001')
                    .with_count(5),
                inventory.ConsumeCount()
                    .with_item_name('item-0002')
                    .with_count(3),
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.consume_simple_items({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    consumeCounts={
        {
            item_name="item-0001",
            count=5,
        },
        {
            item_name="item-0002",
            count=3,
        }
    },
})

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

api_result_handler = client.consume_simple_items_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    consumeCounts={
        {
            item_name="item-0001",
            count=5,
        },
        {
            item_name="item-0002",
            count=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
items = result.items;

```



---

### consumeSimpleItemsByUserId

사용자 ID를 지정하여 심플 아이템 소비<br>

소비 수량의 배치를 사용하여 지정된 사용자의 심플 인벤토리 내 아이템 수량을 감소시킵니다.<br>
단일 원자적 작업으로 여러 아이템을 소비할 수 있습니다. 어느 하나의 아이템 수량이라도 부족한 경우, 작업 전체가 실패합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| consumeCounts | [List&lt;ConsumeCount&gt;](#consumecount) |  | ✓|  | 1 ~ 100 items | 심플 아이템의 소비 수량 리스트 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItem&gt;](#simpleitem) | 소비 후 심플 아이템 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ConsumeSimpleItemsByUserId(
    &inventory.ConsumeSimpleItemsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ConsumeCounts: []inventory.ConsumeCount{
            inventory.ConsumeCount{
                ItemName: pointy.String("item-0001"),
                Count: pointy.Int64(5),
            },
            inventory.ConsumeCount{
                ItemName: pointy.String("item-0002"),
                Count: pointy.Int64(3),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeSimpleItemsByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->consumeSimpleItemsByUserId(
        (new ConsumeSimpleItemsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withConsumeCounts([
                (new ConsumeCount())
                    ->withItemName("item-0001")
                    ->withCount(5),
                (new ConsumeCount())
                    ->withItemName("item-0002")
                    ->withCount(3),
            ])
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.ConsumeSimpleItemsByUserIdResult;

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

try {
    ConsumeSimpleItemsByUserIdResult result = client.consumeSimpleItemsByUserId(
        new ConsumeSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withConsumeCounts(Arrays.asList(
                new ConsumeCount()
                    .withItemName("item-0001")
                    .withCount(5L),
                new ConsumeCount()
                    .withItemName("item-0002")
                    .withCount(3L)
            ))
            .withTimeOffsetToken(null)
    );
    List<SimpleItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeSimpleItemsByUserIdResult> asyncResult = null;
yield return client.ConsumeSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.ConsumeSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithConsumeCounts(new Gs2.Gs2Inventory.Model.ConsumeCount[] {
            new Gs2.Gs2Inventory.Model.ConsumeCount()
                .WithItemName("item-0001")
                .WithCount(5L),
            new Gs2.Gs2Inventory.Model.ConsumeCount()
                .WithItemName("item-0002")
                .WithCount(3L),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.consumeSimpleItemsByUserId(
        new Gs2Inventory.ConsumeSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withConsumeCounts([
                new Gs2Inventory.model.ConsumeCount()
                    .withItemName("item-0001")
                    .withCount(5),
                new Gs2Inventory.model.ConsumeCount()
                    .withItemName("item-0002")
                    .withCount(3),
            ])
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.consume_simple_items_by_user_id(
        inventory.ConsumeSimpleItemsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_consume_counts([
                inventory.ConsumeCount()
                    .with_item_name('item-0001')
                    .with_count(5),
                inventory.ConsumeCount()
                    .with_item_name('item-0002')
                    .with_count(3),
            ])
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.consume_simple_items_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    consumeCounts={
        {
            item_name="item-0001",
            count=5,
        },
        {
            item_name="item-0002",
            count=3,
        }
    },
    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;

```

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

client = gs2('inventory')

api_result_handler = client.consume_simple_items_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    consumeCounts={
        {
            item_name="item-0001",
            count=5,
        },
        {
            item_name="item-0002",
            count=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
items = result.items;

```



---

### setSimpleItemsByUserId

사용자 ID를 지정하여 심플 아이템 설정<br>

단일 원자적 작업으로 여러 심플 아이템의 절대 수량을 설정합니다.<br>
counts 배열로 각 아이템의 이름과 목표 수량을 지정합니다.<br>
입수/소비가 상대적 연산인 것과 달리, 이 경우 현재 수량을 완전히 덮어씁니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| counts | [List&lt;HeldCount&gt;](#heldcount) |  | ✓|  | 1 ~ 100 items | 심플 아이템의 소지 수량 목록 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItem&gt;](#simpleitem) | 갱신 후 심플 아이템 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.SetSimpleItemsByUserId(
    &inventory.SetSimpleItemsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        Counts: []inventory.HeldCount{
            inventory.HeldCount{
                ItemName: pointy.String("item-0001"),
                Count: pointy.Int64(5),
            },
            inventory.HeldCount{
                ItemName: pointy.String("item-0002"),
                Count: pointy.Int64(3),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\SetSimpleItemsByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->setSimpleItemsByUserId(
        (new SetSimpleItemsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withCounts([
                (new HeldCount())
                    ->withItemName("item-0001")
                    ->withCount(5),
                (new HeldCount())
                    ->withItemName("item-0002")
                    ->withCount(3),
            ])
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.SetSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.SetSimpleItemsByUserIdResult;

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

try {
    SetSimpleItemsByUserIdResult result = client.setSimpleItemsByUserId(
        new SetSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withCounts(Arrays.asList(
                new HeldCount()
                    .withItemName("item-0001")
                    .withCount(5L),
                new HeldCount()
                    .withItemName("item-0002")
                    .withCount(3L)
            ))
            .withTimeOffsetToken(null)
    );
    List<SimpleItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.SetSimpleItemsByUserIdResult> asyncResult = null;
yield return client.SetSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.SetSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithCounts(new Gs2.Gs2Inventory.Model.HeldCount[] {
            new Gs2.Gs2Inventory.Model.HeldCount()
                .WithItemName("item-0001")
                .WithCount(5L),
            new Gs2.Gs2Inventory.Model.HeldCount()
                .WithItemName("item-0002")
                .WithCount(3L),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.setSimpleItemsByUserId(
        new Gs2Inventory.SetSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withCounts([
                new Gs2Inventory.model.HeldCount()
                    .withItemName("item-0001")
                    .withCount(5),
                new Gs2Inventory.model.HeldCount()
                    .withItemName("item-0002")
                    .withCount(3),
            ])
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.set_simple_items_by_user_id(
        inventory.SetSimpleItemsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_counts([
                inventory.HeldCount()
                    .with_item_name('item-0001')
                    .with_count(5),
                inventory.HeldCount()
                    .with_item_name('item-0002')
                    .with_count(3),
            ])
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.set_simple_items_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    counts={
        {
            item_name="item-0001",
            count=5,
        },
        {
            item_name="item-0002",
            count=3,
        }
    },
    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;

```

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

client = gs2('inventory')

api_result_handler = client.set_simple_items_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    counts={
        {
            item_name="item-0001",
            count=5,
        },
        {
            item_name="item-0002",
            count=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
items = result.items;

```



---

### deleteSimpleItemsByUserId

심플 아이템 삭제<br>

지정된 사용자의 지정된 심플 인벤토리 내 모든 심플 아이템을 삭제합니다.<br>
인벤토리 내 모든 아이템 데이터가 영구적으로 삭제됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| 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/inventory"
import "github.com/openlyinc/pointy"

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteSimpleItemsByUserId(
    &inventory.DeleteSimpleItemsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteSimpleItemsByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteSimpleItemsByUserId(
        (new DeleteSimpleItemsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.DeleteSimpleItemsByUserIdResult;

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

try {
    DeleteSimpleItemsByUserIdResult result = client.deleteSimpleItemsByUserId(
        new DeleteSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleItemsByUserIdResult> asyncResult = null;
yield return client.DeleteSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.DeleteSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.deleteSimpleItemsByUserId(
        new Gs2Inventory.DeleteSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.delete_simple_items_by_user_id(
        inventory.DeleteSimpleItemsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_simple_items_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="item",
    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('inventory')

api_result_handler = client.delete_simple_items_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    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

```



---

### verifySimpleItem

심플 아이템 소지 수량 검증<br>

요청 사용자의 심플 아이템 수량이 지정된 조건을 만족하는지 검증합니다.<br>
6가지 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.<br>
조건을 만족하지 않는 경우 오류가 반환됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 소지 수량이 지정 값 미만일 것 / lessEqual: 소지 수량이 지정 값 이하일 것 / greater: 소지 수량이 지정 값 초과일 것 / greaterEqual: 소지 수량이 지정 값 이상일 것 / equal: 소지 수량이 지정 값과 일치할 것 / notEqual: 소지 수량이 지정 값과 일치하지 않을 것 /  |
| count | long |  | ✓|  | 0 ~ 9223372036854775805 | 소지 수량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItem](#simpleitem) | 심플 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifySimpleItem(
    &inventory.VerifySimpleItemRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: pointy.Int64(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifySimpleItemRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifySimpleItem(
        (new VerifySimpleItemRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifySimpleItemRequest;
import io.gs2.inventory.result.VerifySimpleItemResult;

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

try {
    VerifySimpleItemResult result = client.verifySimpleItem(
        new VerifySimpleItemRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    SimpleItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifySimpleItemResult> asyncResult = null;
yield return client.VerifySimpleItem(
    new Gs2.Gs2Inventory.Request.VerifySimpleItemRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10L)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifySimpleItem(
        new Gs2Inventory.VerifySimpleItemRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_simple_item(
        inventory.VerifySimpleItemRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_simple_item({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.verify_simple_item_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifySimpleItemByUserId

사용자 ID를 지정하여 심플 아이템 소지 수량 검증<br>

지정된 사용자의 심플 아이템 수량이 지정된 조건을 만족하는지 검증합니다.<br>
6가지 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 심플 아이템 모델의 이름입니다. 이 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 소지 수량이 지정 값 미만일 것 / lessEqual: 소지 수량이 지정 값 이하일 것 / greater: 소지 수량이 지정 값 초과일 것 / greaterEqual: 소지 수량이 지정 값 이상일 것 / equal: 소지 수량이 지정 값과 일치할 것 / notEqual: 소지 수량이 지정 값과 일치하지 않을 것 /  |
| count | long |  | ✓|  | 0 ~ 9223372036854775805 | 소지 수량 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItem](#simpleitem) | 심플 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifySimpleItemByUserId(
    &inventory.VerifySimpleItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: pointy.Int64(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifySimpleItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifySimpleItemByUserId(
        (new VerifySimpleItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifySimpleItemByUserIdRequest;
import io.gs2.inventory.result.VerifySimpleItemByUserIdResult;

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

try {
    VerifySimpleItemByUserIdResult result = client.verifySimpleItemByUserId(
        new VerifySimpleItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    SimpleItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifySimpleItemByUserIdResult> asyncResult = null;
yield return client.VerifySimpleItemByUserId(
    new Gs2.Gs2Inventory.Request.VerifySimpleItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10L)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifySimpleItemByUserId(
        new Gs2Inventory.VerifySimpleItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_simple_item_by_user_id(
        inventory.VerifySimpleItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_simple_item_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.verify_simple_item_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### describeBigItems

거대 아이템 목록 조회<br>

지정된 거대 인벤토리 내에서 요청 사용자가 소지한 거대 아이템의 페이지네이션된 목록을 조회합니다.<br>
거대 아이템은 문자열 기반의 임의 정밀도 수량을 사용하며, 표준적인 정수의 한계를 초과하는 값에 적합합니다.<br>
한 번도 입수한 적 없는 아이템은 결과에 포함되지 않습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;BigItem&gt;](#bigitem) | 거대 아이템 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeBigItems(
    &inventory.DescribeBigItemsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeBigItems(
        (new DescribeBigItemsRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemsRequest;
import io.gs2.inventory.result.DescribeBigItemsResult;

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

try {
    DescribeBigItemsResult result = client.describeBigItems(
        new DescribeBigItemsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<BigItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemsResult> asyncResult = null;
yield return client.DescribeBigItems(
    new Gs2.Gs2Inventory.Request.DescribeBigItemsRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeBigItems(
        new Gs2Inventory.DescribeBigItemsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .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 inventory

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

try:
    result = client.describe_big_items(
        inventory.DescribeBigItemsRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .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('inventory')

api_result = client.describe_big_items({
    namespaceName="namespace-0001",
    inventoryName="item",
    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('inventory')

api_result_handler = client.describe_big_items_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    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;

```



---

### describeBigItemsByUserId

사용자 ID를 지정하여 거대 아이템 목록 조회<br>

지정된 거대 인벤토리 내에서 지정 사용자가 소지한 거대 아이템의 페이지네이션된 목록을 조회합니다.<br>
거대 아이템은 문자열 기반의 임의 정밀도 수량을 사용하며, 표준적인 정수의 한계를 초과하는 값에 적합합니다.<br>
한 번도 입수한 적 없는 아이템은 결과에 포함되지 않습니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;BigItem&gt;](#bigitem) | 거대 아이템 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeBigItemsByUserId(
    &inventory.DescribeBigItemsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemsByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeBigItemsByUserId(
        (new DescribeBigItemsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemsByUserIdRequest;
import io.gs2.inventory.result.DescribeBigItemsByUserIdResult;

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

try {
    DescribeBigItemsByUserIdResult result = client.describeBigItemsByUserId(
        new DescribeBigItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<BigItem> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemsByUserIdResult> asyncResult = null;
yield return client.DescribeBigItemsByUserId(
    new Gs2.Gs2Inventory.Request.DescribeBigItemsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeBigItemsByUserId(
        new Gs2Inventory.DescribeBigItemsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-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 inventory

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

try:
    result = client.describe_big_items_by_user_id(
        inventory.DescribeBigItemsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-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('inventory')

api_result = client.describe_big_items_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-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('inventory')

api_result_handler = client.describe_big_items_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-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;

```



---

### getBigItem

거대 아이템 조회<br>

요청 사용자의 특정 거대 아이템과 그 문자열 기반 임의 정밀도 수량을 조회합니다.<br>
응답에는 거대 아이템 데이터와 이와 관련된 거대 아이템 모델 정의가 모두 포함됩니다.<br>
한 번도 입수한 적 없는 아이템의 경우, 데이터는 반환되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 거대 아이템 모델의 이름입니다. 이 거대 아이템 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 거대 아이템 |
| itemModel | [BigItemModel](#bigitemmodel) | 거대 아이템 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetBigItem(
    &inventory.GetBigItemRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getBigItem(
        (new GetBigItemRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
    );
    $item = $result->getItem();
    $itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemRequest;
import io.gs2.inventory.result.GetBigItemResult;

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

try {
    GetBigItemResult result = client.getBigItem(
        new GetBigItemRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
    );
    BigItem item = result.getItem();
    BigItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemResult> asyncResult = null;
yield return client.GetBigItem(
    new Gs2.Gs2Inventory.Request.GetBigItemRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getBigItem(
        new Gs2Inventory.GetBigItemRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
    );
    const item = result.getItem();
    const itemModel = result.getItemModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_big_item(
        inventory.GetBigItemRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
    )
    item = result.item
    item_model = result.item_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_big_item({
    namespaceName="namespace-0001",
    inventoryName="item",
    accessToken="accessToken-0001",
    itemName="item-0001",
})

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

result = api_result.result
item = result.item;
itemModel = result.itemModel;

```

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

client = gs2('inventory')

api_result_handler = client.get_big_item_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    accessToken="accessToken-0001",
    itemName="item-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;
itemModel = result.itemModel;

```



---

### getBigItemByUserId

사용자 ID를 지정하여 거대 아이템 조회<br>

지정 사용자의 특정 거대 아이템과 그 문자열 기반 임의 정밀도 수량을 조회합니다.<br>
응답에는 거대 아이템 데이터와 이와 관련된 거대 아이템 모델 정의가 모두 포함됩니다.<br>
한 번도 입수한 적 없는 아이템의 경우, 데이터는 반환되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 거대 아이템 모델의 이름입니다. 이 거대 아이템 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 거대 아이템 |
| itemModel | [BigItemModel](#bigitemmodel) | 거대 아이템 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetBigItemByUserId(
    &inventory.GetBigItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getBigItemByUserId(
        (new GetBigItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemByUserIdRequest;
import io.gs2.inventory.result.GetBigItemByUserIdResult;

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

try {
    GetBigItemByUserIdResult result = client.getBigItemByUserId(
        new GetBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withTimeOffsetToken(null)
    );
    BigItem item = result.getItem();
    BigItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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

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

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemByUserIdResult> asyncResult = null;
yield return client.GetBigItemByUserId(
    new Gs2.Gs2Inventory.Request.GetBigItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getBigItemByUserId(
        new Gs2Inventory.GetBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const itemModel = result.getItemModel();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_big_item_by_user_id(
        inventory.GetBigItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    item_model = result.item_model
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_big_item_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-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;
itemModel = result.itemModel;

```

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

client = gs2('inventory')

api_result_handler = client.get_big_item_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-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;
itemModel = result.itemModel;

```



---

### acquireBigItemByUserId

사용자 ID를 지정하여 거대 아이템 입수<br>

임의 정밀도 연산을 사용하여 사용자의 거대 아이템 수량에 지정된 수량을 가산합니다.<br>
acquireCount는 최대 1024자리의 유효한 정수 문자열이어야 하며, 형식이 올바르지 않으면 오류가 발생합니다.<br>
아이템이 아직 존재하지 않는 경우 자동으로 생성됩니다.<br>
네임스페이스 설정을 통해 거대 아이템 입수 시 커스텀 로직을 실행하는 GS2-Script를 설정할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>거대 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| acquireCount | string |  | ✓|  |  ~ 1024자 | 거대 아이템의 입수 수량<br>최대 1024자리까지의 정수값 문자열 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 가산 후 거대 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.AcquireBigItemByUserId(
    &inventory.AcquireBigItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        AcquireCount: pointy.String("1234567890123456789012345678901234567890"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->acquireBigItemByUserId(
        (new AcquireBigItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withAcquireCount("1234567890123456789012345678901234567890")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireBigItemByUserIdRequest;
import io.gs2.inventory.result.AcquireBigItemByUserIdResult;

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

try {
    AcquireBigItemByUserIdResult result = client.acquireBigItemByUserId(
        new AcquireBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withAcquireCount("1234567890123456789012345678901234567890")
            .withTimeOffsetToken(null)
    );
    BigItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireBigItemByUserIdResult> asyncResult = null;
yield return client.AcquireBigItemByUserId(
    new Gs2.Gs2Inventory.Request.AcquireBigItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithAcquireCount("1234567890123456789012345678901234567890")
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.acquireBigItemByUserId(
        new Gs2Inventory.AcquireBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withAcquireCount("1234567890123456789012345678901234567890")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.acquire_big_item_by_user_id(
        inventory.AcquireBigItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_acquire_count('1234567890123456789012345678901234567890')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.acquire_big_item_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    itemName="item-0001",
    acquireCount="1234567890123456789012345678901234567890",
    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('inventory')

api_result_handler = client.acquire_big_item_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    itemName="item-0001",
    acquireCount="1234567890123456789012345678901234567890",
    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;

```



---

### consumeBigItem

거대 아이템 소비<br>

임의 정밀도 연산을 사용하여 요청 사용자의 거대 아이템 수량에서 지정된 수량을 감산합니다.<br>
consumeCount는 최대 1024자리의 유효한 정수 문자열이어야 합니다.<br>
현재 수량이 부족한 경우 Insufficient 오류가 반환되며, 감산은 이루어지지 않습니다.<br>
네임스페이스 설정을 통해 거대 아이템 소비 시 커스텀 로직을 실행하는 GS2-Script를 설정할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>거대 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| consumeCount | string |  | ✓|  |  ~ 1024자 | 거대 아이템의 소비 수량<br>최대 1024자리까지의 정수값 문자열 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 소비 후 거대 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ConsumeBigItem(
    &inventory.ConsumeBigItemRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ItemName: pointy.String("item-0001"),
        ConsumeCount: pointy.String("1234567890123456789012345678901234567890"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeBigItemRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->consumeBigItem(
        (new ConsumeBigItemRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withAccessToken("accessToken-0001")
            ->withItemName("item-0001")
            ->withConsumeCount("1234567890123456789012345678901234567890")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeBigItemRequest;
import io.gs2.inventory.result.ConsumeBigItemResult;

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

try {
    ConsumeBigItemResult result = client.consumeBigItem(
        new ConsumeBigItemRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withConsumeCount("1234567890123456789012345678901234567890")
    );
    BigItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeBigItemResult> asyncResult = null;
yield return client.ConsumeBigItem(
    new Gs2.Gs2Inventory.Request.ConsumeBigItemRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("accessToken-0001")
        .WithItemName("item-0001")
        .WithConsumeCount("1234567890123456789012345678901234567890"),
    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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.consumeBigItem(
        new Gs2Inventory.ConsumeBigItemRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withAccessToken("accessToken-0001")
            .withItemName("item-0001")
            .withConsumeCount("1234567890123456789012345678901234567890")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.consume_big_item(
        inventory.ConsumeBigItemRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_access_token('accessToken-0001')
            .with_item_name('item-0001')
            .with_consume_count('1234567890123456789012345678901234567890')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.consume_big_item({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    consumeCount="1234567890123456789012345678901234567890",
})

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

api_result_handler = client.consume_big_item_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    accessToken="accessToken-0001",
    itemName="item-0001",
    consumeCount="1234567890123456789012345678901234567890",
})

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

```



---

### consumeBigItemByUserId

사용자 ID를 지정하여 거대 아이템 소비<br>

임의 정밀도 연산을 사용하여 지정 사용자의 거대 아이템 수량에서 지정된 수량을 감산합니다.<br>
consumeCount는 최대 1024자리의 유효한 정수 문자열이어야 합니다.<br>
현재 수량이 부족한 경우 Insufficient 오류가 반환되며, 감산은 이루어지지 않습니다.<br>
네임스페이스 설정을 통해 거대 아이템 소비 시 커스텀 로직을 실행하는 GS2-Script를 설정할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>거대 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| consumeCount | string |  | ✓|  |  ~ 1024자 | 거대 아이템의 소비 수량<br>최대 1024자리까지의 정수값 문자열 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 소비 후 거대 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ConsumeBigItemByUserId(
    &inventory.ConsumeBigItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ConsumeCount: pointy.String("1234567890123456789012345678901234567890"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->consumeBigItemByUserId(
        (new ConsumeBigItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withConsumeCount("1234567890123456789012345678901234567890")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeBigItemByUserIdRequest;
import io.gs2.inventory.result.ConsumeBigItemByUserIdResult;

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

try {
    ConsumeBigItemByUserIdResult result = client.consumeBigItemByUserId(
        new ConsumeBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withConsumeCount("1234567890123456789012345678901234567890")
            .withTimeOffsetToken(null)
    );
    BigItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeBigItemByUserIdResult> asyncResult = null;
yield return client.ConsumeBigItemByUserId(
    new Gs2.Gs2Inventory.Request.ConsumeBigItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithConsumeCount("1234567890123456789012345678901234567890")
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.consumeBigItemByUserId(
        new Gs2Inventory.ConsumeBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withConsumeCount("1234567890123456789012345678901234567890")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.consume_big_item_by_user_id(
        inventory.ConsumeBigItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_consume_count('1234567890123456789012345678901234567890')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.consume_big_item_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    consumeCount="1234567890123456789012345678901234567890",
    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('inventory')

api_result_handler = client.consume_big_item_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    consumeCount="1234567890123456789012345678901234567890",
    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;

```



---

### setBigItemByUserId

사용자 ID를 지정하여 거대 아이템 설정<br>

거대 아이템의 수량을 지정된 절대값으로 설정하여 현재 수량을 완전히 대체합니다.<br>
수량은 최대 1024자리의 유효한 정수 문자열이어야 합니다.<br>
아이템이 아직 존재하지 않는 경우 자동으로 생성됩니다.<br>
입수·소비와 같은 상대적 연산과 달리, 정확한 값을 직접 설정합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>거대 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| count | string |  | ✓|  |  ~ 1024자 | 거대 아이템의 수량<br>최대 1024자리까지의 정수값 문자열 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 갱신 후 거대 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.SetBigItemByUserId(
    &inventory.SetBigItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        Count: pointy.String("1234567890123456789012345678901234567890"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\SetBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->setBigItemByUserId(
        (new SetBigItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withCount("1234567890123456789012345678901234567890")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.SetBigItemByUserIdRequest;
import io.gs2.inventory.result.SetBigItemByUserIdResult;

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

try {
    SetBigItemByUserIdResult result = client.setBigItemByUserId(
        new SetBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withCount("1234567890123456789012345678901234567890")
            .withTimeOffsetToken(null)
    );
    BigItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.SetBigItemByUserIdResult> asyncResult = null;
yield return client.SetBigItemByUserId(
    new Gs2.Gs2Inventory.Request.SetBigItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithCount("1234567890123456789012345678901234567890")
        .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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.setBigItemByUserId(
        new Gs2Inventory.SetBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withCount("1234567890123456789012345678901234567890")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.set_big_item_by_user_id(
        inventory.SetBigItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_count('1234567890123456789012345678901234567890')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.set_big_item_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    count="1234567890123456789012345678901234567890",
    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('inventory')

api_result_handler = client.set_big_item_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="inventory-0001",
    userId="user-0001",
    itemName="item-0001",
    count="1234567890123456789012345678901234567890",
    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;

```



---

### deleteBigItemByUserId

거대 아이템 삭제<br>

지정 사용자의 거대 아이템 데이터를 완전히 삭제합니다.<br>
현재 수량과 관계없이 아이템 레코드가 완전히 삭제됩니다.<br>
이 조작은 되돌릴 수 없습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>거대 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 소비 후 거대 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteBigItemByUserId(
    &inventory.DeleteBigItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteBigItemByUserId(
        (new DeleteBigItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withItemName("item-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteBigItemByUserIdRequest;
import io.gs2.inventory.result.DeleteBigItemByUserIdResult;

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

try {
    DeleteBigItemByUserIdResult result = client.deleteBigItemByUserId(
        new DeleteBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withTimeOffsetToken(null)
    );
    BigItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigItemByUserIdResult> asyncResult = null;
yield return client.DeleteBigItemByUserId(
    new Gs2.Gs2Inventory.Request.DeleteBigItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithItemName("item-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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.deleteBigItemByUserId(
        new Gs2Inventory.DeleteBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.delete_big_item_by_user_id(
        inventory.DeleteBigItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_big_item_by_user_id({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    itemName="item-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('inventory')

api_result_handler = client.delete_big_item_by_user_id_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    userId="user-0001",
    itemName="item-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;

```



---

### verifyBigItem

거대 아이템의 소지 수량 검증<br>

요청 사용자의 거대 아이템 수량이 지정된 조건을 충족하는지 검증합니다.<br>
6가지 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.<br>
비교는 문자열 기반 수량에 대해 임의 정밀도 연산으로 수행됩니다.<br>
조건이 충족되지 않으면 오류가 반환되고, 충족되면 요청이 성공합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| accessToken | string |  | ✓|  |  ~ 128자 | 액세스 토큰 |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 거대 아이템 모델의 이름입니다. 이 거대 아이템 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 소지 수량이 지정 값 미만일 것 / lessEqual: 소지 수량이 지정 값 이하일 것 / greater: 소지 수량이 지정 값 초과일 것 / greaterEqual: 소지 수량이 지정 값 이상일 것 / equal: 소지 수량이 지정 값과 일치할 것 / notEqual: 소지 수량이 지정 값과 일치하지 않을 것 /  |
| count | string |  | ✓|  |  ~ 1024자 | 소지 수량<br>최대 1024자리까지의 정수값 문자열 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 갱신 후 거대 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyBigItem(
    &inventory.VerifyBigItemRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: 10,
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyBigItemRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyBigItem(
        (new VerifyBigItemRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyBigItemRequest;
import io.gs2.inventory.result.VerifyBigItemResult;

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

try {
    VerifyBigItemResult result = client.verifyBigItem(
        new VerifyBigItemRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    BigItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyBigItemResult> asyncResult = null;
yield return client.VerifyBigItem(
    new Gs2.Gs2Inventory.Request.VerifyBigItemRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyBigItem(
        new Gs2Inventory.VerifyBigItemRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_big_item(
        inventory.VerifyBigItemRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_big_item({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.verify_big_item_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### verifyBigItemByUserId

사용자 ID를 지정하여 거대 아이템의 소지 수량 검증<br>

지정 사용자의 거대 아이템 수량이 지정된 조건을 충족하는지 검증합니다.<br>
6가지 비교 연산자를 지원합니다: less, lessEqual, greater, greaterEqual, equal, notEqual.<br>
비교는 문자열 기반 수량에 대해 임의 정밀도 연산으로 수행됩니다.<br>
조건이 충족되지 않으면 오류가 반환되고, 충족되면 요청이 성공합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| userId | string |  | ✓|  |  ~ 128자 | 사용자ID |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>이 레코드에 저장된 아이템의 종류를 정의하는 거대 아이템 모델의 이름입니다. 이 거대 아이템 소지품이 어떤 아이템 정의에 대응하는지 식별하는 데 사용됩니다. |
| verifyType | 문자열 열거형<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | 검증 종류less: 소지 수량이 지정 값 미만일 것 / lessEqual: 소지 수량이 지정 값 이하일 것 / greater: 소지 수량이 지정 값 초과일 것 / greaterEqual: 소지 수량이 지정 값 이상일 것 / equal: 소지 수량이 지정 값과 일치할 것 / notEqual: 소지 수량이 지정 값과 일치하지 않을 것 /  |
| count | string |  | ✓|  |  ~ 1024자 | 소지 수량<br>최대 1024자리까지의 정수값 문자열 |
| multiplyValueSpecifyingQuantity | bool |  | | true |  | 수량을 지정했을 때, 검증에 사용하는 값도 곱할지 여부 |
| timeOffsetToken | string |  | |  |  ~ 1024자 | 타임 오프셋 토큰 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItem](#bigitem) | 갱신 후 거대 아이템 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.VerifyBigItemByUserId(
    &inventory.VerifyBigItemByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: 10,
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->verifyBigItemByUserId(
        (new VerifyBigItemByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyBigItemByUserIdRequest;
import io.gs2.inventory.result.VerifyBigItemByUserIdResult;

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

try {
    VerifyBigItemByUserIdResult result = client.verifyBigItemByUserId(
        new VerifyBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    BigItem 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyBigItemByUserIdResult> asyncResult = null;
yield return client.VerifyBigItemByUserId(
    new Gs2.Gs2Inventory.Request.VerifyBigItemByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.verifyBigItemByUserId(
        new Gs2Inventory.VerifyBigItemByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.verify_big_item_by_user_id(
        inventory.VerifyBigItemByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.verify_big_item_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;

```

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

client = gs2('inventory')

api_result_handler = client.verify_big_item_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    inventoryName="inventory-0001",
    itemName="item-0001",
    verifyType="less",
    count=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### describeInventoryModels

인벤토리 모델 목록 취득<br>

네임스페이스 내에서 현재 활성화된 인벤토리 모델의 리스트를 취득합니다.<br>
이는 마스터 데이터의 갱신 프로세스를 통해 활성화된 모델이며, 각 인벤토리 타입의 용량 설정(initialCapacity, maxCapacity)과 아이템 보호 규칙(protectReferencedItem)을 정의합니다.<br>
각 인벤토리 모델에는 해당 인벤토리 내 아이템의 스택 제한과 정렬 순서를 정의하는 관련 아이템 모델이 포함됩니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;InventoryModel&gt;](#inventorymodel) | 인벤토리 모델 리스트 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeInventoryModels(
    &inventory.DescribeInventoryModelsRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoryModelsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeInventoryModels(
        (new DescribeInventoryModelsRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoryModelsRequest;
import io.gs2.inventory.result.DescribeInventoryModelsResult;

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

try {
    DescribeInventoryModelsResult result = client.describeInventoryModels(
        new DescribeInventoryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<InventoryModel> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelsResult> asyncResult = null;
yield return client.DescribeInventoryModels(
    new Gs2.Gs2Inventory.Request.DescribeInventoryModelsRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.describe_inventory_models(
        inventory.DescribeInventoryModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_inventory_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('inventory')

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

```



---

### getInventoryModel

인벤토리 모델을 취득<br>

초기 용량·최대 용량, 아이템 보호 설정 및 관련된 모든 아이템 모델을 포함한 특정 활성화된 인벤토리 모델을 취득합니다.<br>
아이템 모델은 이 인벤토리 내에서의 아이템 저장 방식(스택 제한, 복수 스택 허용, 정렬 값)을 정의합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [InventoryModel](#inventorymodel) | 인벤토리 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetInventoryModel(
    &inventory.GetInventoryModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryModelRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getInventoryModel(
        (new GetInventoryModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryModelRequest;
import io.gs2.inventory.result.GetInventoryModelResult;

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

try {
    GetInventoryModelResult result = client.getInventoryModel(
        new GetInventoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    InventoryModel 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelResult> asyncResult = null;
yield return client.GetInventoryModel(
    new Gs2.Gs2Inventory.Request.GetInventoryModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getInventoryModel(
        new Gs2Inventory.GetInventoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_inventory_model(
        inventory.GetInventoryModelRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_inventory_model({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

api_result_handler = client.get_inventory_model_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

```



---

### describeItemModels

아이템 모델 목록 취득<br>

지정된 인벤토리 모델에 속하는, 현재 활성화된 아이템 모델의 리스트를 취득합니다.<br>
각 아이템 모델은 스택 제한(스택당 최대 수량), 복수 스택 허용 여부, 표시 순서를 위한 정렬 값을 정의합니다.<br>
이들은 마스터 데이터 갱신 프로세스를 통해 활성화된 모델입니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemModel&gt;](#itemmodel) | 아이템 모델 리스트 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeItemModels(
    &inventory.DescribeItemModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemModelsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeItemModels(
        (new DescribeItemModelsRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemModelsRequest;
import io.gs2.inventory.result.DescribeItemModelsResult;

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

try {
    DescribeItemModelsResult result = client.describeItemModels(
        new DescribeItemModelsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    List<ItemModel> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemModelsResult> asyncResult = null;
yield return client.DescribeItemModels(
    new Gs2.Gs2Inventory.Request.DescribeItemModelsRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeItemModels(
        new Gs2Inventory.DescribeItemModelsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.describe_item_models(
        inventory.DescribeItemModelsRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_item_models({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

api_result_handler = client.describe_item_models_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

```



---

### getItemModel

아이템 모델 취득<br>

스택 제한, 복수 스택 허용, 정렬 값, 기타 설정을 포함한 특정 활성화된 아이템 모델을 취득합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [ItemModel](#itemmodel) |  |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetItemModel(
    &inventory.GetItemModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemModelRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getItemModel(
        (new GetItemModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemModelRequest;
import io.gs2.inventory.result.GetItemModelResult;

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

try {
    GetItemModelResult result = client.getItemModel(
        new GetItemModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    ItemModel 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemModelResult> asyncResult = null;
yield return client.GetItemModel(
    new Gs2.Gs2Inventory.Request.GetItemModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getItemModel(
        new Gs2Inventory.GetItemModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_item_model(
        inventory.GetItemModelRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_item_model({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.get_item_model_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---

### describeSimpleInventoryModels

심플 인벤토리 모델 목록 취득<br>

네임스페이스 내에서 현재 활성화된 심플 인벤토리 모델의 목록을 취득합니다.<br>
심플 인벤토리 모델은 용량 제한, 유효 기간, 참조가 없는 간소화된 아이템 관리 시스템을 제공하며, 아이템은 이름과 수량의 쌍으로 추적됩니다.<br>
각 모델에는 관련된 심플 아이템 모델이 포함됩니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleInventoryModel&gt;](#simpleinventorymodel) | 심플 인벤토리 모델 목록 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeSimpleInventoryModels(
    &inventory.DescribeSimpleInventoryModelsRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleInventoryModelsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeSimpleInventoryModels(
        (new DescribeSimpleInventoryModelsRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleInventoryModelsRequest;
import io.gs2.inventory.result.DescribeSimpleInventoryModelsResult;

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

try {
    DescribeSimpleInventoryModelsResult result = client.describeSimpleInventoryModels(
        new DescribeSimpleInventoryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<SimpleInventoryModel> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelsResult> asyncResult = null;
yield return client.DescribeSimpleInventoryModels(
    new Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelsRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.describe_simple_inventory_models(
        inventory.DescribeSimpleInventoryModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_simple_inventory_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('inventory')

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

```



---

### getSimpleInventoryModel

심플 인벤토리 모델 취득<br>

관련된 심플 아이템 모델을 포함하여, 특정 활성 심플 인벤토리 모델을 취득합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleInventoryModel](#simpleinventorymodel) | 심플 인벤토리 모델 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleInventoryModel(
    &inventory.GetSimpleInventoryModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleInventoryModelRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleInventoryModel(
        (new GetSimpleInventoryModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleInventoryModelRequest;
import io.gs2.inventory.result.GetSimpleInventoryModelResult;

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

try {
    GetSimpleInventoryModelResult result = client.getSimpleInventoryModel(
        new GetSimpleInventoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    SimpleInventoryModel 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleInventoryModelResult> asyncResult = null;
yield return client.GetSimpleInventoryModel(
    new Gs2.Gs2Inventory.Request.GetSimpleInventoryModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.getSimpleInventoryModel(
        new Gs2Inventory.GetSimpleInventoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.get_simple_inventory_model(
        inventory.GetSimpleInventoryModelRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_inventory_model({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

api_result_handler = client.get_simple_inventory_model_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

```



---

### describeSimpleItemModels

심플 아이템 모델 목록 취득<br>

지정된 심플 인벤토리 모델에 속하는, 현재 활성화된 심플 아이템 모델의 리스트를 취득합니다.<br>
심플 아이템 모델은 스택 제한, 유효기간, 참조가 없는 이름과 수량의 쌍으로 추적되는 아이템 타입을 정의합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItemModel&gt;](#simpleitemmodel) | 심플 아이템 모델 리스트 |

#### 구현 예제




**Go**
```go

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

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

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

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeSimpleItemModels(
    &inventory.DescribeSimpleItemModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemModelsRequest;

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

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeSimpleItemModels(
        (new DescribeSimpleItemModelsRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemModelsRequest;
import io.gs2.inventory.result.DescribeSimpleItemModelsResult;

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

try {
    DescribeSimpleItemModelsResult result = client.describeSimpleItemModels(
        new DescribeSimpleItemModelsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    List<SimpleItemModel> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemModelsResult> asyncResult = null;
yield return client.DescribeSimpleItemModels(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemModelsRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

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

try {
    const result = await client.describeSimpleItemModels(
        new Gs2Inventory.DescribeSimpleItemModelsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

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

try:
    result = client.describe_simple_item_models(
        inventory.DescribeSimpleItemModelsRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_simple_item_models({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

api_result_handler = client.describe_simple_item_models_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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

```



---

### getSimpleItemModel

심플 아이템 모델을 취득<br>

특정 활성화된 심플 아이템 모델과 그 설정을 취득합니다.


#### Request

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

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItemModel](#simpleitemmodel) |  |

#### 구현 예제




**Go**
```go

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

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleItemModel(
    &inventory.GetSimpleItemModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleItemModel(
        (new GetSimpleItemModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemModelRequest;
import io.gs2.inventory.result.GetSimpleItemModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetSimpleItemModelResult result = client.getSimpleItemModel(
        new GetSimpleItemModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    SimpleItemModel 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemModelResult> asyncResult = null;
yield return client.GetSimpleItemModel(
    new Gs2.Gs2Inventory.Request.GetSimpleItemModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getSimpleItemModel(
        new Gs2Inventory.GetSimpleItemModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_simple_item_model(
        inventory.GetSimpleItemModelRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_item_model({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.get_simple_item_model_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---

### describeBigInventoryModels

거대 인벤토리 모델 목록을 취득<br>

네임스페이스 내에서 현재 활성화된 거대 인벤토리 모델 목록을 취득합니다.<br>
거대 인벤토리 모델은 표준 정수의 한계를 넘는 매우 큰 수량이 필요한 게임을 위해, 문자열 기반 숫자를 사용한 임의 정밀도의 아이템 수량을 지원합니다.<br>
각 모델에는 관련된 거대 아이템 모델이 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;BigInventoryModel&gt;](#biginventorymodel) | 거대 인벤토리 모델 목록 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeBigInventoryModels(
    &inventory.DescribeBigInventoryModelsRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigInventoryModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeBigInventoryModels(
        (new DescribeBigInventoryModelsRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigInventoryModelsRequest;
import io.gs2.inventory.result.DescribeBigInventoryModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeBigInventoryModelsResult result = client.describeBigInventoryModels(
        new DescribeBigInventoryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<BigInventoryModel> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigInventoryModelsResult> asyncResult = null;
yield return client.DescribeBigInventoryModels(
    new Gs2.Gs2Inventory.Request.DescribeBigInventoryModelsRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeBigInventoryModels(
        new Gs2Inventory.DescribeBigInventoryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_big_inventory_models(
        inventory.DescribeBigInventoryModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_big_inventory_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('inventory')

api_result_handler = client.describe_big_inventory_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;

```



---

### getBigInventoryModel

거대 인벤토리 모델을 취득<br>

관련된 거대 아이템 모델을 포함한, 특정 활성화된 거대 인벤토리 모델을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigInventoryModel](#biginventorymodel) | 거대 인벤토리 모델 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetBigInventoryModel(
    &inventory.GetBigInventoryModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigInventoryModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getBigInventoryModel(
        (new GetBigInventoryModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigInventoryModelRequest;
import io.gs2.inventory.result.GetBigInventoryModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetBigInventoryModelResult result = client.getBigInventoryModel(
        new GetBigInventoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    BigInventoryModel 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigInventoryModelResult> asyncResult = null;
yield return client.GetBigInventoryModel(
    new Gs2.Gs2Inventory.Request.GetBigInventoryModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getBigInventoryModel(
        new Gs2Inventory.GetBigInventoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_big_inventory_model(
        inventory.GetBigInventoryModelRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_big_inventory_model({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.get_big_inventory_model_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### describeBigItemModels

거대 아이템 모델 목록 취득<br>

지정된 거대 인벤토리 모델에 속하는, 현재 활성화된 거대 아이템 모델의 리스트를 취득합니다.<br>
거대 아이템 모델은 문자열 기반의 임의 정밀도 수량을 사용하는 아이템 타입을 정의합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;BigItemModel&gt;](#bigitemmodel) | 거대 아이템 모델 리스트 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeBigItemModels(
    &inventory.DescribeBigItemModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeBigItemModels(
        (new DescribeBigItemModelsRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemModelsRequest;
import io.gs2.inventory.result.DescribeBigItemModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeBigItemModelsResult result = client.describeBigItemModels(
        new DescribeBigItemModelsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    List<BigItemModel> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemModelsResult> asyncResult = null;
yield return client.DescribeBigItemModels(
    new Gs2.Gs2Inventory.Request.DescribeBigItemModelsRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeBigItemModels(
        new Gs2Inventory.DescribeBigItemModelsRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_big_item_models(
        inventory.DescribeBigItemModelsRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.describe_big_item_models({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.describe_big_item_models_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### getBigItemModel

거대 아이템 모델을 취득<br>

특정 활성화된 거대 아이템 모델과 그 설정을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델 이름<br>거대 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItemModel](#bigitemmodel) |  |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetBigItemModel(
    &inventory.GetBigItemModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getBigItemModel(
        (new GetBigItemModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemModelRequest;
import io.gs2.inventory.result.GetBigItemModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetBigItemModelResult result = client.getBigItemModel(
        new GetBigItemModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    BigItemModel 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemModelResult> asyncResult = null;
yield return client.GetBigItemModel(
    new Gs2.Gs2Inventory.Request.GetBigItemModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getBigItemModel(
        new Gs2Inventory.GetBigItemModelRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_big_item_model(
        inventory.GetBigItemModelRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_big_item_model({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.get_big_item_model_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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>

네임스페이스에서 현재의 인벤토리 모델 마스터, 아이템 모델 마스터, 심플 인벤토리/아이템 모델 마스터, 거대 인벤토리/아이템 모델 마스터를 JSON 형식으로 내보냅니다.<br>
내보낸 데이터는 변경 사항을 활성화하기 위한 마스터 데이터 갱신 API의 입력으로 사용할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentItemModelMaster](#currentitemmodelmaster) | 활성화 가능한 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ExportMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ExportMasterRequest;
import io.gs2.inventory.result.ExportMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.exportMaster(
        new Gs2Inventory.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.export_master(
        inventory.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

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('inventory')

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;

```



---

### getCurrentItemModelMaster

현재 활성화된 아이템 모델의 마스터 데이터를 취득<br>

네임스페이스에서 마지막으로 활성화된 마스터 데이터를 취득합니다.<br>
서비스에서 현재 사용되고 있는 모든 인벤토리 모델(표준, 심플, 거대)과 그 관련 아이템 모델이 포함됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentItemModelMaster](#currentitemmodelmaster) | 현재 활성화된 아이템 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetCurrentItemModelMaster(
    &inventory.GetCurrentItemModelMasterRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetCurrentItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getCurrentItemModelMaster(
        (new GetCurrentItemModelMasterRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetCurrentItemModelMasterRequest;
import io.gs2.inventory.result.GetCurrentItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetCurrentItemModelMasterResult result = client.getCurrentItemModelMaster(
        new GetCurrentItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetCurrentItemModelMasterResult> asyncResult = null;
yield return client.GetCurrentItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetCurrentItemModelMasterRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getCurrentItemModelMaster(
        new Gs2Inventory.GetCurrentItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_current_item_model_master(
        inventory.GetCurrentItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_current_item_model_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.get_current_item_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### preUpdateCurrentItemModelMaster

현재 활성화된 아이템 모델의 마스터 데이터를 갱신(3단계 버전)<br>

1MB를 초과하는 마스터 데이터를 업로드하는 경우 3단계로 갱신을 수행합니다.<br>
1. 이 API를 실행하여 업로드용 토큰과 URL을 취득합니다.<br>
2. 취득한 URL에 마스터 데이터를 업로드합니다.<br>
3. UpdateCurrentItemModelMaster에 업로드로 취득한 토큰을 전달하여 실행하면 마스터 데이터가 반영됩니다.


#### 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/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentItemModelMaster(
    &inventory.PreUpdateCurrentItemModelMasterRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\PreUpdateCurrentItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentItemModelMaster(
        (new PreUpdateCurrentItemModelMasterRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.PreUpdateCurrentItemModelMasterRequest;
import io.gs2.inventory.result.PreUpdateCurrentItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    PreUpdateCurrentItemModelMasterResult result = client.preUpdateCurrentItemModelMaster(
        new PreUpdateCurrentItemModelMasterRequest()
            .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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.PreUpdateCurrentItemModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentItemModelMaster(
    new Gs2.Gs2Inventory.Request.PreUpdateCurrentItemModelMasterRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.preUpdateCurrentItemModelMaster(
        new Gs2Inventory.PreUpdateCurrentItemModelMasterRequest()
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.pre_update_current_item_model_master(
        inventory.PreUpdateCurrentItemModelMasterRequest()
            .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('inventory')

api_result = client.pre_update_current_item_model_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.pre_update_current_item_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

```



---

### updateCurrentItemModelMaster

현재 활성화된 아이템 모델의 마스터 데이터를 갱신<br>

현재 활성화된 인벤토리 및 아이템 모델 정의를 대체하는 새로운 마스터 데이터를 활성화합니다.<br>
2가지 모드를 지원합니다: 'direct'(1MB 미만의 데이터에 적합한 인라인 형식), 'preUpload'(사전 업로드 API로 업로드된 데이터용).<br>
활성화 후에는 모든 인벤토리 조작이 새로운 모델 정의를 사용합니다.


#### 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 | [CurrentItemModelMaster](#currentitemmodelmaster) | 갱신된 현재 활성화된 아이템 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentItemModelMaster(
    &inventory.UpdateCurrentItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateCurrentItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateCurrentItemModelMaster(
        (new UpdateCurrentItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateCurrentItemModelMasterRequest;
import io.gs2.inventory.result.UpdateCurrentItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateCurrentItemModelMasterResult result = client.updateCurrentItemModelMaster(
        new UpdateCurrentItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
            .withUploadToken(null)
    );
    CurrentItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateCurrentItemModelMaster(
        new Gs2Inventory.UpdateCurrentItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_current_item_model_master(
        inventory.UpdateCurrentItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2019-02-05", "inventoryModels": [{"name": "item", "metadata": "INVENTORY_ITEM", "initialCapacity": 100, "maxCapacity": 999, "itemModels": [{"name": "item-0001", "metadata": "ITEM_0001", "stackingLimit": 99, "allowMultipleStacks": false, "sortValue": 1}, {"name": "item-0002", "metadata": "ITEM_0002", "stackingLimit": 49, "allowMultipleStacks": true, "sortValue": 2}, {"name": "item-0003", "metadata": "ITEM_0003", "stackingLimit": 9, "allowMultipleStacks": false, "sortValue": 3}]}, {"name": "character", "metadata": "INVENTORY_CHARACTER", "initialCapacity": 50, "maxCapacity": 99, "itemModels": [{"name": "character-0001", "metadata": "CHARACTER_0001", "stackingLimit": 99, "allowMultipleStacks": false, "sortValue": 1}, {"name": "character-0002", "metadata": "CHARACTER_0002", "stackingLimit": 49, "allowMultipleStacks": true, "sortValue": 2}, {"name": "character-0003", "metadata": "CHARACTER_0003", "stackingLimit": 9, "allowMultipleStacks": false, "sortValue": 3}]}], "simpleInventoryModels": [{"name": "item", "metadata": "INVENTORY_ITEM", "simpleItemModels": [{"name": "item-0001", "metadata": "ITEM_0001"}, {"name": "item-0002", "metadata": "ITEM_0002"}, {"name": "item-0003", "metadata": "ITEM_0003"}]}], "bigInventoryModels": [{"name": "item", "metadata": "INVENTORY_ITEM", "bigItemModels": [{"name": "item-0001", "metadata": "ITEM_0001"}, {"name": "item-0002", "metadata": "ITEM_0002"}, {"name": "item-0003", "metadata": "ITEM_0003"}]}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.update_current_item_model_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}",
    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('inventory')

api_result_handler = client.update_current_item_model_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}",
    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;

```



---

### updateCurrentItemModelMasterFromGitHub

현재 활성화된 아이템 모델의 마스터 데이터를 GitHub에서 갱신<br>

지정된 GitHub 저장소에서 마스터 데이터를 취득하여 활성화합니다.<br>
체크아웃 설정에서 저장소, 브랜치/태그, 취득할 파일 경로를 지정합니다.<br>
마스터 데이터 내의 템플릿 변수는 활성화 시 설정된 값으로 치환됩니다.<br>
Git 워크플로를 통한 버전 관리된 마스터 데이터 관리를 가능하게 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| checkoutSetting | [GitHubCheckoutSetting](#githubcheckoutsetting) |  | ✓|  |  | GitHub에서 마스터 데이터를 체크아웃하는 설정 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [CurrentItemModelMaster](#currentitemmodelmaster) | 갱신된 현재 활성화된 아이템 모델의 마스터 데이터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentItemModelMasterFromGitHub(
    &inventory.UpdateCurrentItemModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateCurrentItemModelMasterFromGitHubRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateCurrentItemModelMasterFromGitHub(
        (new UpdateCurrentItemModelMasterFromGitHubRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateCurrentItemModelMasterFromGitHubRequest;
import io.gs2.inventory.result.UpdateCurrentItemModelMasterFromGitHubResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateCurrentItemModelMasterFromGitHubResult result = client.updateCurrentItemModelMasterFromGitHub(
        new UpdateCurrentItemModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentItemModelMasterFromGitHub(
    new Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateCurrentItemModelMasterFromGitHub(
        new Gs2Inventory.UpdateCurrentItemModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Inventory.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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_current_item_model_master_from_git_hub(
        inventory.UpdateCurrentItemModelMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(inventory.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('inventory')

api_result = client.update_current_item_model_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.update_current_item_model_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### describeInventoryModelMasters

인벤토리 모델 마스터 목록 조회<br>

네임스페이스 내의 편집 가능한 인벤토리 모델 마스터의 페이지네이션된 목록을 조회합니다.<br>
이는 활성화 전에 변경 가능한 초안 정의입니다. 각 마스터는 인벤토리 타입의 용량 설정(initialCapacity, maxCapacity)과 아이템 보호 규칙을 정의합니다.<br>
이름 접두사에 의한 선택적 필터링을 지원합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 인벤토리 모델명 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;InventoryModelMaster&gt;](#inventorymodelmaster) | 인벤토리 모델 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeInventoryModelMasters(
    &inventory.DescribeInventoryModelMastersRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoryModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeInventoryModelMasters(
        (new DescribeInventoryModelMastersRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoryModelMastersRequest;
import io.gs2.inventory.result.DescribeInventoryModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeInventoryModelMastersResult result = client.describeInventoryModelMasters(
        new DescribeInventoryModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<InventoryModelMaster> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeInventoryModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeInventoryModelMastersRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeInventoryModelMasters(
        new Gs2Inventory.DescribeInventoryModelMastersRequest()
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_inventory_model_masters(
        inventory.DescribeInventoryModelMastersRequest()
            .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('inventory')

api_result = client.describe_inventory_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('inventory')

api_result_handler = client.describe_inventory_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;

```



---

### createInventoryModelMaster

인벤토리 모델 마스터 신규 생성<br>

새로운 인벤토리 타입을 정의하는 편집 가능한 인벤토리 모델 마스터를 생성합니다.<br>
주요 설정에는 initialCapacity(신규 사용자의 초기 아이템 슬롯 수), maxCapacity(용량 확장 상한), protectReferencedItem(활성화 시 활성 참조가 있는 아이템의 소비를 방지)이 포함됩니다.<br>
생성한 마스터는 마스터 데이터 갱신 프로세스를 통해 활성화해야 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| initialCapacity | int |  | ✓|  | 0 ~ 2147483646 | 초기 크기<br>인벤토리가 처음 생성될 때 사용자에게 제공되는 인벤토리 칸의 수입니다. 각 칸에는 하나의 아이템 스택을 저장할 수 있습니다. 사용자는 게임 플레이 액션을 통해 maxCapacity까지 용량을 확장할 수 있습니다. |
| maxCapacity | int |  | ✓|  | 0 ~ 2147483646 | 최대 크기<br>사용자가 확장할 수 있는 인벤토리 칸의 상한값입니다. 이 값을 초과하여 용량을 늘릴 수 없습니다. 모든 칸이 사용 중이고 아이템을 더 이상 스택할 수 없는 경우, 오버플로우 스크립트가 초과분을 처리하지 않는 한 입수는 실패합니다. |
| protectReferencedItem | bool |  | | false |  | 참조된 아이템 보호<br>활성화하면 (referenceOf 메커니즘을 통해) 참조가 등록된 아이템 세트는 소비하거나 삭제할 수 없게 됩니다. 다른 시스템에서 사용 중인 아이템(예: 장착 중인 장비, 편성에 연결된 아이템)이 실수로 삭제되는 것을 방지합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [InventoryModelMaster](#inventorymodelmaster) | 생성한 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateInventoryModelMaster(
    &inventory.CreateInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("item"),
        Description: nil,
        Metadata: nil,
        InitialCapacity: pointy.Int32(50),
        MaxCapacity: pointy.Int32(100),
        ProtectReferencedItem: 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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->createInventoryModelMaster(
        (new CreateInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("item")
            ->withDescription(null)
            ->withMetadata(null)
            ->withInitialCapacity(50)
            ->withMaxCapacity(100)
            ->withProtectReferencedItem(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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateInventoryModelMasterRequest;
import io.gs2.inventory.result.CreateInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    CreateInventoryModelMasterResult result = client.createInventoryModelMaster(
        new CreateInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
            .withInitialCapacity(50)
            .withMaxCapacity(100)
            .withProtectReferencedItem(null)
    );
    InventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateInventoryModelMasterResult> asyncResult = null;
yield return client.CreateInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.CreateInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("item")
        .WithDescription(null)
        .WithMetadata(null)
        .WithInitialCapacity(50)
        .WithMaxCapacity(100)
        .WithProtectReferencedItem(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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createInventoryModelMaster(
        new Gs2Inventory.CreateInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
            .withInitialCapacity(50)
            .withMaxCapacity(100)
            .withProtectReferencedItem(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_inventory_model_master(
        inventory.CreateInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('item')
            .with_description(None)
            .with_metadata(None)
            .with_initial_capacity(50)
            .with_max_capacity(100)
            .with_protect_referenced_item(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.create_inventory_model_master({
    namespaceName="namespace-0001",
    name="item",
    description=nil,
    metadata=nil,
    initialCapacity=50,
    maxCapacity=100,
    protectReferencedItem=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('inventory')

api_result_handler = client.create_inventory_model_master_async({
    namespaceName="namespace-0001",
    name="item",
    description=nil,
    metadata=nil,
    initialCapacity=50,
    maxCapacity=100,
    protectReferencedItem=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;

```



---

### getInventoryModelMaster

인벤토리 모델 마스터 조회<br>

용량 설정, 메타데이터, 아이템 보호 규칙을 포함한 특정 편집 가능한 인벤토리 모델 마스터의 전체 설정을 조회합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [InventoryModelMaster](#inventorymodelmaster) | 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetInventoryModelMaster(
    &inventory.GetInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getInventoryModelMaster(
        (new GetInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryModelMasterRequest;
import io.gs2.inventory.result.GetInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetInventoryModelMasterResult result = client.getInventoryModelMaster(
        new GetInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    InventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelMasterResult> asyncResult = null;
yield return client.GetInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.GetInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getInventoryModelMaster(
        new Gs2Inventory.GetInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_inventory_model_master(
        inventory.GetInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.get_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### updateInventoryModelMaster

인벤토리 모델 마스터 갱신<br>

용량 설정(initialCapacity, maxCapacity), 메타데이터, protectReferencedItem을 포함한 기존 인벤토리 모델 마스터의 속성을 갱신합니다.<br>
변경 사항은 마스터 데이터 갱신 프로세스를 통해 재활성화될 때까지 반영되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |
| initialCapacity | int |  | ✓|  | 0 ~ 2147483646 | 초기 크기<br>인벤토리가 처음 생성될 때 사용자에게 제공되는 인벤토리 칸의 수입니다. 각 칸에는 하나의 아이템 스택을 저장할 수 있습니다. 사용자는 게임 플레이 액션을 통해 maxCapacity까지 용량을 확장할 수 있습니다. |
| maxCapacity | int |  | ✓|  | 0 ~ 2147483646 | 최대 크기<br>사용자가 확장할 수 있는 인벤토리 칸의 상한값입니다. 이 값을 초과하여 용량을 늘릴 수 없습니다. 모든 칸이 사용 중이고 아이템을 더 이상 스택할 수 없는 경우, 오버플로우 스크립트가 초과분을 처리하지 않는 한 입수는 실패합니다. |
| protectReferencedItem | bool |  | | false |  | 참조된 아이템 보호<br>활성화하면 (referenceOf 메커니즘을 통해) 참조가 등록된 아이템 세트는 소비하거나 삭제할 수 없게 됩니다. 다른 시스템에서 사용 중인 아이템(예: 장착 중인 장비, 편성에 연결된 아이템)이 실수로 삭제되는 것을 방지합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [InventoryModelMaster](#inventorymodelmaster) | 갱신한 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateInventoryModelMaster(
    &inventory.UpdateInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
        InitialCapacity: pointy.Int32(150),
        MaxCapacity: pointy.Int32(250),
        ProtectReferencedItem: 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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateInventoryModelMaster(
        (new UpdateInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withDescription("description1")
            ->withMetadata("ITEM_INVENTORY_MASTER")
            ->withInitialCapacity(150)
            ->withMaxCapacity(250)
            ->withProtectReferencedItem(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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateInventoryModelMasterRequest;
import io.gs2.inventory.result.UpdateInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateInventoryModelMasterResult result = client.updateInventoryModelMaster(
        new UpdateInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
            .withInitialCapacity(150)
            .withMaxCapacity(250)
            .withProtectReferencedItem(null)
    );
    InventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithDescription("description1")
        .WithMetadata("ITEM_INVENTORY_MASTER")
        .WithInitialCapacity(150)
        .WithMaxCapacity(250)
        .WithProtectReferencedItem(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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateInventoryModelMaster(
        new Gs2Inventory.UpdateInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
            .withInitialCapacity(150)
            .withMaxCapacity(250)
            .withProtectReferencedItem(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_inventory_model_master(
        inventory.UpdateInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_description('description1')
            .with_metadata('ITEM_INVENTORY_MASTER')
            .with_initial_capacity(150)
            .with_max_capacity(250)
            .with_protect_referenced_item(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.update_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
    initialCapacity=150,
    maxCapacity=250,
    protectReferencedItem=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('inventory')

api_result_handler = client.update_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
    initialCapacity=150,
    maxCapacity=250,
    protectReferencedItem=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;

```



---

### deleteInventoryModelMaster

인벤토리 모델 마스터 삭제<br>

지정된 인벤토리 모델 마스터를 삭제합니다.<br>
삭제는 마스터 데이터가 재활성화될 때까지 현재 활성 상태인 모델에 영향을 미치지 않습니다.<br>
이 모델과 관련된 기존 사용자 인벤토리나 아이템은 자동으로 삭제되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [InventoryModelMaster](#inventorymodelmaster) | 삭제한 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteInventoryModelMaster(
    &inventory.DeleteInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteInventoryModelMaster(
        (new DeleteInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteInventoryModelMasterRequest;
import io.gs2.inventory.result.DeleteInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DeleteInventoryModelMasterResult result = client.deleteInventoryModelMaster(
        new DeleteInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    InventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteInventoryModelMaster(
        new Gs2Inventory.DeleteInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_inventory_model_master(
        inventory.DeleteInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.delete_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### describeItemModelMasters

아이템 모델 마스터 목록 취득<br>

지정된 인벤토리 모델 마스터에 속하는, 편집 가능한 아이템 모델 마스터의 페이지네이션 목록을 취득합니다.<br>
이들은 유효화 이전에 변경 가능한 초안 정의이며, 인벤토리 내 아이템의 스택 제한, 복수 스택 허용 여부, 정렬 값을 정의합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;ItemModelMaster&gt;](#itemmodelmaster) | 아이템 모델 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeItemModelMasters(
    &inventory.DescribeItemModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeItemModelMasters(
        (new DescribeItemModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemModelMastersRequest;
import io.gs2.inventory.result.DescribeItemModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeItemModelMastersResult result = client.describeItemModelMasters(
        new DescribeItemModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ItemModelMaster> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemModelMastersResult> asyncResult = null;
yield return client.DescribeItemModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeItemModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeItemModelMasters(
        new Gs2Inventory.DescribeItemModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_item_model_masters(
        inventory.DescribeItemModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .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('inventory')

api_result = client.describe_item_model_masters({
    namespaceName="namespace-0001",
    inventoryName="item",
    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('inventory')

api_result_handler = client.describe_item_model_masters_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    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;

```



---

### createItemModelMaster

아이템 모델 마스터 신규 생성<br>

지정된 인벤토리 내의 새로운 아이템 타입을 정의하는 편집 가능한 아이템 모델 마스터를 생성합니다.<br>
주요 설정으로는 stackingLimit(스택당 최대 수량), allowMultipleStacks(동일한 아이템이 여러 인벤토리 슬롯을 차지할 수 있는지 여부), sortValue(표시 순서 우선도)가 있습니다.<br>
allowMultipleStacks가 활성화된 경우, 스택 제한을 초과하는 아이템 획득은 실패하지 않고 추가 ItemSet 엔트리를 생성합니다.<br>
생성한 마스터는 마스터 데이터 갱신 프로세스를 통해 유효화해야 사용할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>이 아이템이 속한 인벤토리 모델의 이름입니다. 이 아이템 종류를 저장할 수 있는 인벤토리를 결정하고, 인벤토리의 용량 설정 및 보호 설정과 연관시킵니다. |
| name | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>GS2-Enhance에는 GS2-Inventory와 연동하여 강화를 수행하는 처리가 있으며, ItemModel의 메타데이터에 JSON 형식으로 강화 소재로 사용했을 때의 경험치량을 설정합니다.<br>자세한 내용은 [마이크로서비스 소개 / GS2-Enhance](/microservices/enhance/#강화-레이트) 항목에서 설명하고 있습니다. |
| stackingLimit | long |  | ✓|  | 1 ~ 9223372036854775805 | 스택 가능한 최대 수량<br>하나의 인벤토리 칸(스택)에 보관할 수 있는 이 아이템의 최대 수입니다. 이 상한에 도달하면 allowMultipleStacks 설정에 따라 새로운 칸이 할당되거나 추가 입수가 차단됩니다. |
| allowMultipleStacks | bool |  | ✓|  |  | 복수 스택 허용<br>활성화하면 스택 상한에 도달했을 때 새로운 인벤토리 칸이 자동으로 할당되어 이 아이템의 추가 수량을 저장합니다(추가 용량을 소비합니다). 비활성화하면 기존 칸에서 스택 상한에 도달한 시점에 입수가 차단됩니다. |
| sortValue | int |  | ✓|  | 0 ~ 2147483646 | 표시 순서<br>인벤토리 내 아이템을 표시용으로 정렬하기 위한 수치입니다. 값이 작을수록 먼저 표시됩니다. 이 값은 ItemSet 레코드에도 복사되어 소지 아이템의 일관된 정렬을 가능하게 합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [ItemModelMaster](#itemmodelmaster) | 생성한 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateItemModelMaster(
    &inventory.CreateItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        Name: pointy.String("item-master-0001"),
        Description: nil,
        Metadata: nil,
        StackingLimit: pointy.Int64(99),
        AllowMultipleStacks: pointy.Bool(false),
        SortValue: pointy.Int32(10),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->createItemModelMaster(
        (new CreateItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withName("item-master-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withStackingLimit(99)
            ->withAllowMultipleStacks(false)
            ->withSortValue(10)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateItemModelMasterRequest;
import io.gs2.inventory.result.CreateItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    CreateItemModelMasterResult result = client.createItemModelMaster(
        new CreateItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
            .withStackingLimit(99L)
            .withAllowMultipleStacks(false)
            .withSortValue(10)
    );
    ItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateItemModelMasterResult> asyncResult = null;
yield return client.CreateItemModelMaster(
    new Gs2.Gs2Inventory.Request.CreateItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithName("item-master-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithStackingLimit(99L)
        .WithAllowMultipleStacks(false)
        .WithSortValue(10),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createItemModelMaster(
        new Gs2Inventory.CreateItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
            .withStackingLimit(99)
            .withAllowMultipleStacks(false)
            .withSortValue(10)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_item_model_master(
        inventory.CreateItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_name('item-master-0001')
            .with_description(None)
            .with_metadata(None)
            .with_stacking_limit(99)
            .with_allow_multiple_stacks(False)
            .with_sort_value(10)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.create_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    name="item-master-0001",
    description=nil,
    metadata=nil,
    stackingLimit=99,
    allowMultipleStacks=false,
    sortValue=10,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.create_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    name="item-master-0001",
    description=nil,
    metadata=nil,
    stackingLimit=99,
    allowMultipleStacks=false,
    sortValue=10,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getItemModelMaster

아이템 모델 마스터 취득<br>

스택 제한, 복수 스택 허용 여부, 정렬 값, 메타데이터를 포함한, 특정 편집 가능한 아이템 모델 마스터의 전체 설정을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [ItemModelMaster](#itemmodelmaster) | 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetItemModelMaster(
    &inventory.GetItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getItemModelMaster(
        (new GetItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemModelMasterRequest;
import io.gs2.inventory.result.GetItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetItemModelMasterResult result = client.getItemModelMaster(
        new GetItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    ItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemModelMasterResult> asyncResult = null;
yield return client.GetItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getItemModelMaster(
        new Gs2Inventory.GetItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_item_model_master(
        inventory.GetItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.get_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---

### updateItemModelMaster

아이템 모델 마스터 갱신<br>

스택 제한, 복수 스택 허용 여부, 정렬 값, 메타데이터를 포함한 기존 아이템 모델 마스터의 속성을 갱신합니다.<br>
변경 사항은 마스터 데이터 갱신 프로세스를 통해 재유효화될 때까지 반영되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>GS2-Enhance에는 GS2-Inventory와 연동하여 강화를 수행하는 처리가 있으며, ItemModel의 메타데이터에 JSON 형식으로 강화 소재로 사용했을 때의 경험치량을 설정합니다.<br>자세한 내용은 [마이크로서비스 소개 / GS2-Enhance](/microservices/enhance/#강화-레이트) 항목에서 설명하고 있습니다. |
| stackingLimit | long |  | ✓|  | 1 ~ 9223372036854775805 | 스택 가능한 최대 수량<br>하나의 인벤토리 칸(스택)에 보관할 수 있는 이 아이템의 최대 수입니다. 이 상한에 도달하면 allowMultipleStacks 설정에 따라 새로운 칸이 할당되거나 추가 입수가 차단됩니다. |
| allowMultipleStacks | bool |  | ✓|  |  | 복수 스택 허용<br>활성화하면 스택 상한에 도달했을 때 새로운 인벤토리 칸이 자동으로 할당되어 이 아이템의 추가 수량을 저장합니다(추가 용량을 소비합니다). 비활성화하면 기존 칸에서 스택 상한에 도달한 시점에 입수가 차단됩니다. |
| sortValue | int |  | ✓|  | 0 ~ 2147483646 | 표시 순서<br>인벤토리 내 아이템을 표시용으로 정렬하기 위한 수치입니다. 값이 작을수록 먼저 표시됩니다. 이 값은 ItemSet 레코드에도 복사되어 소지 아이템의 일관된 정렬을 가능하게 합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [ItemModelMaster](#itemmodelmaster) | 갱신한 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateItemModelMaster(
    &inventory.UpdateItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_MASTER_0001"),
        StackingLimit: pointy.Int64(49),
        AllowMultipleStacks: pointy.Bool(true),
        SortValue: pointy.Int32(30),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateItemModelMaster(
        (new UpdateItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-0001")
            ->withDescription("description1")
            ->withMetadata("ITEM_MASTER_0001")
            ->withStackingLimit(49)
            ->withAllowMultipleStacks(true)
            ->withSortValue(30)
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateItemModelMasterRequest;
import io.gs2.inventory.result.UpdateItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateItemModelMasterResult result = client.updateItemModelMaster(
        new UpdateItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
            .withDescription("description1")
            .withMetadata("ITEM_MASTER_0001")
            .withStackingLimit(49L)
            .withAllowMultipleStacks(true)
            .withSortValue(30)
    );
    ItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateItemModelMasterResult> asyncResult = null;
yield return client.UpdateItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-0001")
        .WithDescription("description1")
        .WithMetadata("ITEM_MASTER_0001")
        .WithStackingLimit(49L)
        .WithAllowMultipleStacks(true)
        .WithSortValue(30),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateItemModelMaster(
        new Gs2Inventory.UpdateItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
            .withDescription("description1")
            .withMetadata("ITEM_MASTER_0001")
            .withStackingLimit(49)
            .withAllowMultipleStacks(true)
            .withSortValue(30)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_item_model_master(
        inventory.UpdateItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
            .with_description('description1')
            .with_metadata('ITEM_MASTER_0001')
            .with_stacking_limit(49)
            .with_allow_multiple_stacks(True)
            .with_sort_value(30)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.update_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-0001",
    description="description1",
    metadata="ITEM_MASTER_0001",
    stackingLimit=49,
    allowMultipleStacks=true,
    sortValue=30,
})

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('inventory')

api_result_handler = client.update_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-0001",
    description="description1",
    metadata="ITEM_MASTER_0001",
    stackingLimit=49,
    allowMultipleStacks=true,
    sortValue=30,
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### deleteItemModelMaster

아이템 모델 마스터 삭제<br>

지정된 아이템 모델 마스터를 삭제합니다.<br>
삭제는 마스터 데이터가 재유효화될 때까지 현재 활성 모델에 영향을 미치지 않습니다.<br>
이 모델과 관련된 기존 사용자 아이템은 자동으로 삭제되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 인벤토리 모델명<br>인벤토리 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 아이템 모델명<br>아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [ItemModelMaster](#itemmodelmaster) | 삭제한 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteItemModelMaster(
    &inventory.DeleteItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteItemModelMaster(
        (new DeleteItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteItemModelMasterRequest;
import io.gs2.inventory.result.DeleteItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DeleteItemModelMasterResult result = client.deleteItemModelMaster(
        new DeleteItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    ItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteItemModelMasterResult> asyncResult = null;
yield return client.DeleteItemModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteItemModelMaster(
        new Gs2Inventory.DeleteItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_item_model_master(
        inventory.DeleteItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.delete_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---

### describeSimpleInventoryModelMasters

심플 인벤토리 모델 마스터 목록 취득<br>

네임스페이스 내의 편집 가능한 심플 인벤토리 모델 마스터의 페이지네이션 목록을 취득합니다.<br>
이들은 마스터 데이터 갱신 프로세스를 통한 유효화 이전에 변경 가능한 초안 정의입니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 심플 인벤토리 모델 이름 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleInventoryModelMaster&gt;](#simpleinventorymodelmaster) | 심플 인벤토리 모델 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeSimpleInventoryModelMasters(
    &inventory.DescribeSimpleInventoryModelMastersRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleInventoryModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeSimpleInventoryModelMasters(
        (new DescribeSimpleInventoryModelMastersRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleInventoryModelMastersRequest;
import io.gs2.inventory.result.DescribeSimpleInventoryModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeSimpleInventoryModelMastersResult result = client.describeSimpleInventoryModelMasters(
        new DescribeSimpleInventoryModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SimpleInventoryModelMaster> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeSimpleInventoryModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelMastersRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeSimpleInventoryModelMasters(
        new Gs2Inventory.DescribeSimpleInventoryModelMastersRequest()
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_simple_inventory_model_masters(
        inventory.DescribeSimpleInventoryModelMastersRequest()
            .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('inventory')

api_result = client.describe_simple_inventory_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('inventory')

api_result_handler = client.describe_simple_inventory_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;

```



---

### createSimpleInventoryModelMaster

심플 인벤토리 모델 마스터 신규 생성<br>

편집 가능한 심플 인벤토리 모델 마스터를 생성합니다.<br>
일반 인벤토리 모델과 달리 심플 인벤토리 모델에는 용량 제한, 아이템 유효 기간, 참조 관리가 없습니다.<br>
생성한 마스터는 마스터 데이터 갱신 프로세스를 통해 유효화해야 사용할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleInventoryModelMaster](#simpleinventorymodelmaster) | 생성한 심플 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateSimpleInventoryModelMaster(
    &inventory.CreateSimpleInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("item"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateSimpleInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->createSimpleInventoryModelMaster(
        (new CreateSimpleInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("item")
            ->withDescription(null)
            ->withMetadata(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.CreateSimpleInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    CreateSimpleInventoryModelMasterResult result = client.createSimpleInventoryModelMaster(
        new CreateSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
    );
    SimpleInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.CreateSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.CreateSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("item")
        .WithDescription(null)
        .WithMetadata(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createSimpleInventoryModelMaster(
        new Gs2Inventory.CreateSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_simple_inventory_model_master(
        inventory.CreateSimpleInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('item')
            .with_description(None)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.create_simple_inventory_model_master({
    namespaceName="namespace-0001",
    name="item",
    description=nil,
    metadata=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.create_simple_inventory_model_master_async({
    namespaceName="namespace-0001",
    name="item",
    description=nil,
    metadata=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getSimpleInventoryModelMaster

심플 인벤토리 모델 마스터 취득<br>

특정 편집 가능한 심플 인벤토리 모델 마스터의 전체 설정을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleInventoryModelMaster](#simpleinventorymodelmaster) | 심플 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleInventoryModelMaster(
    &inventory.GetSimpleInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleInventoryModelMaster(
        (new GetSimpleInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.GetSimpleInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetSimpleInventoryModelMasterResult result = client.getSimpleInventoryModelMaster(
        new GetSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    SimpleInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.GetSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.GetSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getSimpleInventoryModelMaster(
        new Gs2Inventory.GetSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_simple_inventory_model_master(
        inventory.GetSimpleInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.get_simple_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### updateSimpleInventoryModelMaster

심플 인벤토리 모델 마스터 갱신<br>

기존 심플 인벤토리 모델 마스터의 속성을 갱신합니다.<br>
변경 사항은 마스터 데이터가 재유효화될 때까지 반영되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleInventoryModelMaster](#simpleinventorymodelmaster) | 갱신한 심플 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateSimpleInventoryModelMaster(
    &inventory.UpdateSimpleInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateSimpleInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateSimpleInventoryModelMaster(
        (new UpdateSimpleInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withDescription("description1")
            ->withMetadata("ITEM_INVENTORY_MASTER")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.UpdateSimpleInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateSimpleInventoryModelMasterResult result = client.updateSimpleInventoryModelMaster(
        new UpdateSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
    );
    SimpleInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithDescription("description1")
        .WithMetadata("ITEM_INVENTORY_MASTER"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateSimpleInventoryModelMaster(
        new Gs2Inventory.UpdateSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_simple_inventory_model_master(
        inventory.UpdateSimpleInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_description('description1')
            .with_metadata('ITEM_INVENTORY_MASTER')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.update_simple_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
})

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('inventory')

api_result_handler = client.update_simple_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### deleteSimpleInventoryModelMaster

심플 인벤토리 모델 마스터 삭제<br>

지정된 심플 인벤토리 모델 마스터를 삭제합니다.<br>
삭제는 마스터 데이터가 재유효화될 때까지 현재 활성 모델에 영향을 미치지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleInventoryModelMaster](#simpleinventorymodelmaster) | 삭제한 심플 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteSimpleInventoryModelMaster(
    &inventory.DeleteSimpleInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteSimpleInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteSimpleInventoryModelMaster(
        (new DeleteSimpleInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.DeleteSimpleInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DeleteSimpleInventoryModelMasterResult result = client.deleteSimpleInventoryModelMaster(
        new DeleteSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    SimpleInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteSimpleInventoryModelMaster(
        new Gs2Inventory.DeleteSimpleInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_simple_inventory_model_master(
        inventory.DeleteSimpleInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_simple_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.delete_simple_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### describeSimpleItemModelMasters

심플 아이템 모델 마스터 목록 취득<br>

지정된 심플 인벤토리 모델 마스터에 속하는, 편집 가능한 심플 아이템 모델 마스터의 페이지네이션 목록을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 심플 아이템 모델 이름 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;SimpleItemModelMaster&gt;](#simpleitemmodelmaster) | 심플 아이템 모델 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeSimpleItemModelMasters(
    &inventory.DescribeSimpleItemModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeSimpleItemModelMasters(
        (new DescribeSimpleItemModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemModelMastersRequest;
import io.gs2.inventory.result.DescribeSimpleItemModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeSimpleItemModelMastersResult result = client.describeSimpleItemModelMasters(
        new DescribeSimpleItemModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SimpleItemModelMaster> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemModelMastersResult> asyncResult = null;
yield return client.DescribeSimpleItemModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeSimpleItemModelMasters(
        new Gs2Inventory.DescribeSimpleItemModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_simple_item_model_masters(
        inventory.DescribeSimpleItemModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .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('inventory')

api_result = client.describe_simple_item_model_masters({
    namespaceName="namespace-0001",
    inventoryName="item",
    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('inventory')

api_result_handler = client.describe_simple_item_model_masters_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    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;

```



---

### createSimpleItemModelMaster

심플 아이템 모델 마스터 신규 생성<br>

지정된 심플 인벤토리 내의 새로운 아이템 타입을 정의하는 편집 가능한 심플 아이템 모델 마스터를 생성합니다.<br>
생성한 마스터는 마스터 데이터 갱신 프로세스를 통해 유효화해야 사용할 수 있습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>심플 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItemModelMaster](#simpleitemmodelmaster) | 생성한 심플 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateSimpleItemModelMaster(
    &inventory.CreateSimpleItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        Name: pointy.String("item-master-0001"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateSimpleItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->createSimpleItemModelMaster(
        (new CreateSimpleItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withName("item-master-0001")
            ->withDescription(null)
            ->withMetadata(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateSimpleItemModelMasterRequest;
import io.gs2.inventory.result.CreateSimpleItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    CreateSimpleItemModelMasterResult result = client.createSimpleItemModelMaster(
        new CreateSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    SimpleItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateSimpleItemModelMasterResult> asyncResult = null;
yield return client.CreateSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.CreateSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithName("item-master-0001")
        .WithDescription(null)
        .WithMetadata(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createSimpleItemModelMaster(
        new Gs2Inventory.CreateSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_simple_item_model_master(
        inventory.CreateSimpleItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_name('item-master-0001')
            .with_description(None)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.create_simple_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    name="item-master-0001",
    description=nil,
    metadata=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.create_simple_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    name="item-master-0001",
    description=nil,
    metadata=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getSimpleItemModelMaster

심플 아이템 모델 마스터 취득<br>

특정 편집 가능한 심플 아이템 모델 마스터의 전체 설정을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>심플 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItemModelMaster](#simpleitemmodelmaster) | 심플 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetSimpleItemModelMaster(
    &inventory.GetSimpleItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getSimpleItemModelMaster(
        (new GetSimpleItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemModelMasterRequest;
import io.gs2.inventory.result.GetSimpleItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetSimpleItemModelMasterResult result = client.getSimpleItemModelMaster(
        new GetSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    SimpleItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemModelMasterResult> asyncResult = null;
yield return client.GetSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getSimpleItemModelMaster(
        new Gs2Inventory.GetSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_simple_item_model_master(
        inventory.GetSimpleItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_simple_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.get_simple_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---

### updateSimpleItemModelMaster

심플 아이템 모델 마스터 갱신<br>

기존 심플 아이템 모델 마스터의 속성을 갱신합니다.<br>
변경 사항은 마스터 데이터가 재유효화될 때까지 반영되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>심플 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItemModelMaster](#simpleitemmodelmaster) | 갱신한 심플 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateSimpleItemModelMaster(
    &inventory.UpdateSimpleItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_MASTER_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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateSimpleItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateSimpleItemModelMaster(
        (new UpdateSimpleItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-0001")
            ->withDescription("description1")
            ->withMetadata("ITEM_MASTER_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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateSimpleItemModelMasterRequest;
import io.gs2.inventory.result.UpdateSimpleItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateSimpleItemModelMasterResult result = client.updateSimpleItemModelMaster(
        new UpdateSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
            .withDescription("description1")
            .withMetadata("ITEM_MASTER_0001")
    );
    SimpleItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateSimpleItemModelMasterResult> asyncResult = null;
yield return client.UpdateSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-0001")
        .WithDescription("description1")
        .WithMetadata("ITEM_MASTER_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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateSimpleItemModelMaster(
        new Gs2Inventory.UpdateSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
            .withDescription("description1")
            .withMetadata("ITEM_MASTER_0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_simple_item_model_master(
        inventory.UpdateSimpleItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
            .with_description('description1')
            .with_metadata('ITEM_MASTER_0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.update_simple_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-0001",
    description="description1",
    metadata="ITEM_MASTER_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('inventory')

api_result_handler = client.update_simple_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-0001",
    description="description1",
    metadata="ITEM_MASTER_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;

```



---

### deleteSimpleItemModelMaster

심플 아이템 모델 마스터 삭제<br>

지정된 심플 아이템 모델 마스터를 삭제합니다.<br>
삭제는 마스터 데이터가 재유효화될 때까지 현재 활성 모델에 영향을 미치지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 심플 인벤토리 모델 이름<br>심플 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 심플 아이템 모델 이름<br>심플 아이템 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [SimpleItemModelMaster](#simpleitemmodelmaster) | 삭제한 심플 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteSimpleItemModelMaster(
    &inventory.DeleteSimpleItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteSimpleItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteSimpleItemModelMaster(
        (new DeleteSimpleItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteSimpleItemModelMasterRequest;
import io.gs2.inventory.result.DeleteSimpleItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DeleteSimpleItemModelMasterResult result = client.deleteSimpleItemModelMaster(
        new DeleteSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    SimpleItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleItemModelMasterResult> asyncResult = null;
yield return client.DeleteSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteSimpleItemModelMaster(
        new Gs2Inventory.DeleteSimpleItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_simple_item_model_master(
        inventory.DeleteSimpleItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_simple_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.delete_simple_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---

### describeBigInventoryModelMasters

거대 인벤토리 모델 마스터 목록 취득<br>

네임스페이스 내의 편집 가능한 거대 인벤토리 모델 마스터의 페이지네이션 리스트를 취득합니다.<br>
이는 임의 정밀도의 아이템 수량을 사용하는 인벤토리 타입의 초안 정의입니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 거대 인벤토리 모델명 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;BigInventoryModelMaster&gt;](#biginventorymodelmaster) | 거대 인벤토리 모델 마스터 리스트 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeBigInventoryModelMasters(
    &inventory.DescribeBigInventoryModelMastersRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigInventoryModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeBigInventoryModelMasters(
        (new DescribeBigInventoryModelMastersRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigInventoryModelMastersRequest;
import io.gs2.inventory.result.DescribeBigInventoryModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeBigInventoryModelMastersResult result = client.describeBigInventoryModelMasters(
        new DescribeBigInventoryModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<BigInventoryModelMaster> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeBigInventoryModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeBigInventoryModelMastersRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeBigInventoryModelMasters(
        new Gs2Inventory.DescribeBigInventoryModelMastersRequest()
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_big_inventory_model_masters(
        inventory.DescribeBigInventoryModelMastersRequest()
            .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('inventory')

api_result = client.describe_big_inventory_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('inventory')

api_result_handler = client.describe_big_inventory_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;

```



---

### createBigInventoryModelMaster

거대 인벤토리 모델 마스터를 신규 작성<br>

임의 정밀도의 아이템 관리를 위한 편집 가능한 거대 인벤토리 모델 마스터를 생성합니다.<br>
생성한 마스터는 마스터 데이터 갱신 프로세스를 통해 활성화해야 합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigInventoryModelMaster](#biginventorymodelmaster) | 생성한 거대 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateBigInventoryModelMaster(
    &inventory.CreateBigInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("item"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateBigInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->createBigInventoryModelMaster(
        (new CreateBigInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("item")
            ->withDescription(null)
            ->withMetadata(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateBigInventoryModelMasterRequest;
import io.gs2.inventory.result.CreateBigInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    CreateBigInventoryModelMasterResult result = client.createBigInventoryModelMaster(
        new CreateBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
    );
    BigInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateBigInventoryModelMasterResult> asyncResult = null;
yield return client.CreateBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.CreateBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("item")
        .WithDescription(null)
        .WithMetadata(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createBigInventoryModelMaster(
        new Gs2Inventory.CreateBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_big_inventory_model_master(
        inventory.CreateBigInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('item')
            .with_description(None)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.create_big_inventory_model_master({
    namespaceName="namespace-0001",
    name="item",
    description=nil,
    metadata=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.create_big_inventory_model_master_async({
    namespaceName="namespace-0001",
    name="item",
    description=nil,
    metadata=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getBigInventoryModelMaster

거대 인벤토리 모델 마스터를 취득<br>

특정 편집 가능한 거대 인벤토리 모델 마스터의 전체 설정을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigInventoryModelMaster](#biginventorymodelmaster) | 거대 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetBigInventoryModelMaster(
    &inventory.GetBigInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getBigInventoryModelMaster(
        (new GetBigInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigInventoryModelMasterRequest;
import io.gs2.inventory.result.GetBigInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetBigInventoryModelMasterResult result = client.getBigInventoryModelMaster(
        new GetBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    BigInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigInventoryModelMasterResult> asyncResult = null;
yield return client.GetBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.GetBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getBigInventoryModelMaster(
        new Gs2Inventory.GetBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_big_inventory_model_master(
        inventory.GetBigInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_big_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.get_big_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### updateBigInventoryModelMaster

거대 인벤토리 모델 마스터를 갱신<br>

기존 거대 인벤토리 모델 마스터의 속성을 갱신합니다.<br>
변경 사항은 마스터 데이터가 재활성화될 때까지 반영되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigInventoryModelMaster](#biginventorymodelmaster) | 갱신한 거대 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateBigInventoryModelMaster(
    &inventory.UpdateBigInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateBigInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateBigInventoryModelMaster(
        (new UpdateBigInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withDescription("description1")
            ->withMetadata("ITEM_INVENTORY_MASTER")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateBigInventoryModelMasterRequest;
import io.gs2.inventory.result.UpdateBigInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateBigInventoryModelMasterResult result = client.updateBigInventoryModelMaster(
        new UpdateBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
    );
    BigInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateBigInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithDescription("description1")
        .WithMetadata("ITEM_INVENTORY_MASTER"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateBigInventoryModelMaster(
        new Gs2Inventory.UpdateBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_big_inventory_model_master(
        inventory.UpdateBigInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_description('description1')
            .with_metadata('ITEM_INVENTORY_MASTER')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.update_big_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
})

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('inventory')

api_result_handler = client.update_big_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### deleteBigInventoryModelMaster

거대 인벤토리 모델 마스터를 삭제<br>

지정된 거대 인벤토리 모델 마스터를 삭제합니다.<br>
삭제는 마스터 데이터가 재활성화될 때까지 현재 활성화된 모델에 영향을 주지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigInventoryModelMaster](#biginventorymodelmaster) | 삭제한 거대 인벤토리 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteBigInventoryModelMaster(
    &inventory.DeleteBigInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteBigInventoryModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteBigInventoryModelMaster(
        (new DeleteBigInventoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteBigInventoryModelMasterRequest;
import io.gs2.inventory.result.DeleteBigInventoryModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DeleteBigInventoryModelMasterResult result = client.deleteBigInventoryModelMaster(
        new DeleteBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    BigInventoryModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteBigInventoryModelMaster(
        new Gs2Inventory.DeleteBigInventoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_big_inventory_model_master(
        inventory.DeleteBigInventoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_big_inventory_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
})

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('inventory')

api_result_handler = client.delete_big_inventory_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler 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;

```



---

### describeBigItemModelMasters

거대 아이템 모델 마스터 목록을 취득<br>

지정된 거대 인벤토리 모델 마스터에 속하는, 편집 가능한 거대 아이템 모델 마스터의 페이지네이션 목록을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| namePrefix | string |  | |  |  ~ 64자 | 거대 아이템 모델 이름 필터 접두사 |
| pageToken | string |  | |  |  ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 |
| limit | int |  | | 30 | 1 ~ 1000 | 취득할 데이터 건수 |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| items | [List&lt;BigItemModelMaster&gt;](#bigitemmodelmaster) | 거대 아이템 모델 마스터 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeBigItemModelMasters(
    &inventory.DescribeBigItemModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->describeBigItemModelMasters(
        (new DescribeBigItemModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemModelMastersRequest;
import io.gs2.inventory.result.DescribeBigItemModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DescribeBigItemModelMastersResult result = client.describeBigItemModelMasters(
        new DescribeBigItemModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<BigItemModelMaster> 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemModelMastersResult> asyncResult = null;
yield return client.DescribeBigItemModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeBigItemModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeBigItemModelMasters(
        new Gs2Inventory.DescribeBigItemModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_big_item_model_masters(
        inventory.DescribeBigItemModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .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('inventory')

api_result = client.describe_big_item_model_masters({
    namespaceName="namespace-0001",
    inventoryName="item",
    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('inventory')

api_result_handler = client.describe_big_item_model_masters_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    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;

```



---

### createBigItemModelMaster

거대 아이템 모델 마스터를 신규 생성<br>

지정된 거대 인벤토리 내의 임의 정밀도 수량을 가진 새로운 아이템 타입을 정의하는 편집 가능한 거대 아이템 모델 마스터를 생성합니다.<br>
생성한 마스터는 마스터 데이터 갱신 프로세스를 통해 유효화해야 사용할 수 있게 됩니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| name | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델명<br>거대 아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItemModelMaster](#bigitemmodelmaster) | 생성한 거대 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateBigItemModelMaster(
    &inventory.CreateBigItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        Name: pointy.String("item-master-0001"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateBigItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->createBigItemModelMaster(
        (new CreateBigItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withName("item-master-0001")
            ->withDescription(null)
            ->withMetadata(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateBigItemModelMasterRequest;
import io.gs2.inventory.result.CreateBigItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    CreateBigItemModelMasterResult result = client.createBigItemModelMaster(
        new CreateBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    BigItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateBigItemModelMasterResult> asyncResult = null;
yield return client.CreateBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.CreateBigItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithName("item-master-0001")
        .WithDescription(null)
        .WithMetadata(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createBigItemModelMaster(
        new Gs2Inventory.CreateBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_big_item_model_master(
        inventory.CreateBigItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_name('item-master-0001')
            .with_description(None)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.create_big_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    name="item-master-0001",
    description=nil,
    metadata=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('inventory')

api_result_handler = client.create_big_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    name="item-master-0001",
    description=nil,
    metadata=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getBigItemModelMaster

거대 아이템 모델 마스터를 취득<br>

특정 편집 가능한 거대 아이템 모델 마스터의 전체 설정을 취득합니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델명<br>거대 아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItemModelMaster](#bigitemmodelmaster) | 거대 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetBigItemModelMaster(
    &inventory.GetBigItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->getBigItemModelMaster(
        (new GetBigItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemModelMasterRequest;
import io.gs2.inventory.result.GetBigItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    GetBigItemModelMasterResult result = client.getBigItemModelMaster(
        new GetBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    BigItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemModelMasterResult> asyncResult = null;
yield return client.GetBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetBigItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getBigItemModelMaster(
        new Gs2Inventory.GetBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_big_item_model_master(
        inventory.GetBigItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.get_big_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.get_big_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---

### updateBigItemModelMaster

거대 아이템 모델 마스터를 갱신<br>

기존 거대 아이템 모델 마스터의 속성을 갱신합니다.<br>
변경 사항은 마스터 데이터가 재유효화될 때까지 반영되지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델명<br>거대 아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| description | string |  | |  |  ~ 1024자 | 설명문 |
| metadata | string |  | |  |  ~ 2048자 | 메타데이터<br>메타데이터에는 임의의 값을 설정할 수 있습니다.<br>이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItemModelMaster](#bigitemmodelmaster) | 갱신한 거대 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateBigItemModelMaster(
    &inventory.UpdateBigItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_MASTER_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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateBigItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->updateBigItemModelMaster(
        (new UpdateBigItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-0001")
            ->withDescription("description1")
            ->withMetadata("ITEM_MASTER_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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateBigItemModelMasterRequest;
import io.gs2.inventory.result.UpdateBigItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    UpdateBigItemModelMasterResult result = client.updateBigItemModelMaster(
        new UpdateBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
            .withDescription("description1")
            .withMetadata("ITEM_MASTER_0001")
    );
    BigItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateBigItemModelMasterResult> asyncResult = null;
yield return client.UpdateBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateBigItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-0001")
        .WithDescription("description1")
        .WithMetadata("ITEM_MASTER_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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateBigItemModelMaster(
        new Gs2Inventory.UpdateBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
            .withDescription("description1")
            .withMetadata("ITEM_MASTER_0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_big_item_model_master(
        inventory.UpdateBigItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
            .with_description('description1')
            .with_metadata('ITEM_MASTER_0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.update_big_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-0001",
    description="description1",
    metadata="ITEM_MASTER_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('inventory')

api_result_handler = client.update_big_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-0001",
    description="description1",
    metadata="ITEM_MASTER_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;

```



---

### deleteBigItemModelMaster

거대 아이템 모델 마스터를 삭제<br>

지정된 거대 아이템 모델 마스터를 삭제합니다.<br>
삭제는 마스터 데이터가 재유효화될 때까지 현재 활성화된 모델에 영향을 주지 않습니다.


#### Request

|  | 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128자 | 네임스페이스 이름<br>네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
| inventoryName | string |  | ✓|  |  ~ 128자 | 거대 인벤토리 모델 이름<br>거대 인벤토리 모델 고유 이름입니다. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다. |
| itemName | string |  | ✓|  |  ~ 128자 | 거대 아이템 모델명<br>거대 아이템 모델 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |

#### Result

|  | 타입 | 설명 |
| --- | --- | --- |
| item | [BigItemModelMaster](#bigitemmodelmaster) | 삭제한 거대 아이템 모델 마스터 |

#### 구현 예제




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteBigItemModelMaster(
    &inventory.DeleteBigItemModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteBigItemModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2InventoryRestClient(
    $session
);

try {
    $result = $client->deleteBigItemModelMaster(
        (new DeleteBigItemModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withInventoryName("item")
            ->withItemName("item-master-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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteBigItemModelMasterRequest;
import io.gs2.inventory.result.DeleteBigItemModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);

try {
    DeleteBigItemModelMasterResult result = client.deleteBigItemModelMaster(
        new DeleteBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    BigItemModelMaster 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 Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigItemModelMasterResult> asyncResult = null;
yield return client.DeleteBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteBigItemModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithInventoryName("item")
        .WithItemName("item-master-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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteBigItemModelMaster(
        new Gs2Inventory.DeleteBigItemModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_big_item_model_master(
        inventory.DeleteBigItemModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_inventory_name('item')
            .with_item_name('item-master-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('inventory')

api_result = client.delete_big_item_model_master({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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('inventory')

api_result_handler = client.delete_big_item_model_master_async({
    namespaceName="namespace-0001",
    inventoryName="item",
    itemName="item-master-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;

```



---



