GS2-Showcase Deploy/CDK 레퍼런스

GS2-Deploy의 스택을 생성할 때 사용하는 템플릿 포맷과, CDK를 이용한 각종 언어의 템플릿 출력 구현 예제

엔티티

Deploy 처리에서 조작 대상이 되는 리소스

Namespace

네임스페이스

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

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

Request

리소스 생성·갱신 요청

타입활성화 조건필수기본값값 제한설명
namestring
~ 128자네임스페이스 이름
네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다.
descriptionstring~ 1024자설명문
transactionSettingV2TransactionSettingV2트랜잭션 설정(V2)
이 네임스페이스가 발행하는 트랜잭션을 어떻게 실행할지 정하는 설정입니다. 설정하는 항목은 실행에 사용하는 GS2-Distributor 네임스페이스와, 트랜잭션에 포함된 액션을 한 건씩 실행해 앞서 실행된 액션의 결과를 후속 액션에서 사용할 수 있게 할지, 한꺼번에 동시에 실행해 응답 시간을 줄일지의 2가지뿐입니다.
새로 생성하는 네임스페이스에서는 이쪽을 설정하십시오. 이것으로 대체되어 비권장이 된 transactionSetting은 이쪽이 설정되어 있지 않은 동안에만 사용됩니다.
buyScriptScriptSetting구매를 실행하려고 할 때 실행하는 스크립트 설정
Script 트리거 레퍼런스 - buy
logSettingLogSetting로그 출력 설정
진열대 열람이나 상품 구매에 관한 API 요청·응답 로그를 출력하는 GS2-Log의 네임스페이스를 지정합니다.

GetAttr

!GetAttr 태그로 취득 가능한 리소스 생성 결과

타입설명
ItemNamespace생성한 네임스페이스

구현 예제

Type: GS2::Showcase::Namespace
Properties:
  Name: namespace-0001
  Description: null
  TransactionSettingV2: null
  BuyScript: null
  LogSetting: 
    LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001
import (
    "github.com/gs2io/gs2-golang-cdk/core"
    "github.com/gs2io/gs2-golang-cdk/showcase"
)


SampleStack := core.NewStack()
showcase.NewNamespace(
    &SampleStack,
    "namespace-0001",
    showcase.NamespaceOptions{
        LogSetting: &core.LogSetting{
            LoggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
        },
    },
)

println(SampleStack.Yaml())  // Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Showcase\Model\Namespace_(
            stack: $this,
            name: "namespace-0001",
            options: new \Gs2Cdk\Showcase\Model\Options\NamespaceOptions(
                logSetting: new \Gs2Cdk\Core\Model\LogSetting(
                    loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                )
            )
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.showcase.model.Namespace(
                this,
                "namespace-0001",
                new io.gs2.cdk.showcase.model.options.NamespaceOptions()
                        .withLogSetting(new io.gs2.cdk.core.model.LogSetting(
                            "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                        ))
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Showcase.Model.Namespace(
            stack: this,
            name: "namespace-0001",
            options: new Gs2Cdk.Gs2Showcase.Model.Options.NamespaceOptions
            {
                logSetting = new Gs2Cdk.Core.Model.LogSetting(
                    loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                )
            }
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template
import core from "@/gs2cdk/core";
import showcase from "@/gs2cdk/showcase";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new showcase.model.Namespace(
            this,
            "namespace-0001",
            {
                logSetting: new core.LogSetting(
                    "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                )
            }
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
from gs2_cdk import Stack, core, showcase

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        showcase.Namespace(
            stack=self,
            name='namespace-0001',
            options=showcase.NamespaceOptions(
                log_setting=core.LogSetting(
                    logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
                ),
            ),
        )

print(SampleStack().yaml())  # Generate Template

TransactionSettingV2

트랜잭션 설정(V2)

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

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

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

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

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

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

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

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

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

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

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

ScriptSetting

스크립트 설정

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

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

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

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

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

LogSetting

로그 출력 설정

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

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

TransactionSetting

트랜잭션 설정

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

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

타입활성화 조건필수기본값값 제한설명
enableAutoRunboolfalse발행한 트랜잭션을 서버 사이드에서 자동으로 실행할지 여부
enableAtomicCommitbool{enableAutoRun} == truefalse트랜잭션의 실행을 원자적으로 커밋할지 여부
※ enableAutoRun이(가) true 이면 활성화
transactionUseDistributorbool{enableAtomicCommit} == truefalse트랜잭션을 비동기 처리로 실행할지 여부
※ enableAtomicCommit이(가) true 이면 활성화
commitScriptResultInUseDistributorbool{transactionUseDistributor} == truefalse스크립트의 결과 커밋 처리를 비동기 처리로 실행할지 여부
※ transactionUseDistributor이(가) true 이면 활성화
acquireActionUseJobQueuebool{enableAtomicCommit} == truefalse입수 액션을 실행할 때 GS2-JobQueue를 사용할지 여부
※ enableAtomicCommit이(가) true 이면 활성화
enableSequentialExecutionbool{enableAtomicCommit} == truefalse원자적 커밋의 액션을 직렬로 실행하여 여러 액션이 같은 행을 갱신할 수 있도록 할지 여부
※ enableAtomicCommit이(가) true 이면 활성화
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024자트랜잭션 실행에 사용하는 GS2-Distributor 네임스페이스 GRN
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024자트랜잭션 실행에 사용하는 GS2-JobQueue의 네임스페이스 GRN

CurrentShowcaseMaster

현재 활성화된 진열대 모델의 마스터 데이터

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

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

Request

리소스 생성·갱신 요청

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

GetAttr

!GetAttr 태그로 취득 가능한 리소스 생성 결과

타입설명
ItemCurrentShowcaseMaster업데이트된 현재 활성화된 쇼케이스의 마스터 데이터

구현 예제

Type: GS2::Showcase::CurrentShowcaseMaster
Properties:
  NamespaceName: namespace-0001
  Mode: direct
  Settings: {
    "version": "2019-04-04",
    "showcases": [
      {
        "name": "gem",
        "displayItems": [
          {
            "type": "salesItem",
              "salesItem": {
              "name": "gem_3000",
              "metadata": "GEM_3000",
              "consumeActions": [
                {
                  "action": "Gs2Money:RecordReceipt",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "contentsId": "contentsId-0001",
                    "receipt": "#{receipt}",
                    "userId": "#{userId}"
                  }
                }
              ],
              "acquireActions": [
                {
                  "action": "Gs2Money:DepositByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "slot": 0,
                    "price": 100,
                    "count": 1,
                    "userId": "#{userId}"
                  }
                }
              ]
              }
          },
          {
            "type": "salesItemGroup",
            "salesPeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",
              "salesItemGroup": {
              "name": "step_gem",
              "metadata": "STEP_GEM",
              "salesItems": [
                {
                  "name": "step1_gem_1000",
                  "metadata": "STEP1_GEM_1000",
                  "consumeActions": [
                    {
                      "action": "Gs2Money:RecordReceipt",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "contentsId": "contentsId-0001",
                        "receipt": "#{receipt}",
                        "userId": "#{userId}"
                      }
                    },
                    {
                      "action": "Gs2Limit:CountUpByUserId",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "limitName": "limit-0001",
                        "counterName": "counter-0001",
                        "countUpValue": 1,
                        "maxValue": 100,
                        "userId": "#{userId}"
                      }
                    }
                  ],
                  "acquireActions": [
                    {
                      "action": "Gs2Money:DepositByUserId",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "slot": 0,
                        "price": 100,
                        "count": 1,
                        "userId": "#{userId}"
                      }
                    }
                  ]
                },
                {
                  "name": "step2_gem_2000",
                  "metadata": "STEP1_GEM_2000",
                  "consumeActions": [
                    {
                      "action": "Gs2Money:RecordReceipt",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "contentsId": "contentsId-0001",
                        "receipt": "#{receipt}",
                        "userId": "#{userId}"
                      }
                    },
                    {
                      "action": "Gs2Limit:CountUpByUserId",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "limitName": "limit-0001",
                        "counterName": "counter-0001",
                        "countUpValue": 1,
                        "maxValue": 100,
                        "userId": "#{userId}"
                      }
                    }
                  ],
                  "acquireActions": [
                    {
                      "action": "Gs2Money:DepositByUserId",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "slot": 0,
                        "price": 100,
                        "count": 1,
                        "userId": "#{userId}"
                      }
                    }
                  ]
                }
              ]
              }
          }
        ],
        "metadata": "GEM"
      },
      {
        "name": "gacha",
        "displayItems": [
          {
            "type": "salesItem",
              "salesItem": {
              "name": "single",
              "metadata": "SINGLE",
              "consumeActions": [
                {
                  "action": "Gs2Money:WithdrawByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "slot": 0,
                    "count": 1,
                    "paidOnly": false,
                    "userId": "#{userId}"
                  }
                }
              ],
              "acquireActions": [
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expiresAt": 0,
                    "createNewItemSet": false,
                    "itemSetName": "",
                    "userId": "#{userId}"
                  }
                }
              ]
              }
          },
          {
            "type": "salesItem",
              "salesItem": {
              "name": "10times",
              "metadata": "10TIMES",
              "consumeActions": [
                {
                  "action": "Gs2Money:WithdrawByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "slot": 0,
                    "count": 1,
                    "paidOnly": false,
                    "userId": "#{userId}"
                  }
                }
              ],
              "acquireActions": [
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expiresAt": 0,
                    "createNewItemSet": false,
                    "itemSetName": "",
                    "userId": "#{userId}"
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expiresAt": 0,
                    "createNewItemSet": false,
                    "itemSetName": "",
                    "userId": "#{userId}"
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expiresAt": 0,
                    "createNewItemSet": false,
                    "itemSetName": "",
                    "userId": "#{userId}"
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expiresAt": 0,
                    "createNewItemSet": false,
                    "itemSetName": "",
                    "userId": "#{userId}"
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expiresAt": 0,
                    "createNewItemSet": false,
                    "itemSetName": "",
                    "userId": "#{userId}"
                  }
                }
              ]
              }
          }
        ],
        "metadata": "GACHA"
      }
    ],
    "randomShowcases": []
    
  }
  UploadToken: null
import (
    "github.com/gs2io/gs2-golang-cdk/core"
    "github.com/gs2io/gs2-golang-cdk/showcase"
    "github.com/gs2io/gs2-golang-cdk/money"
    "github.com/gs2io/gs2-golang-cdk/limit"
    "github.com/gs2io/gs2-golang-cdk/inventory"
    "github.com/openlyinc/pointy"
)


SampleStack := core.NewStack()
showcase.NewNamespace(
    &SampleStack,
    "namespace-0001",
    showcase.NamespaceOptions{},
).MasterData(
    []showcase.Showcase{
        showcase.NewShowcase(
            "gem",
            []showcase.DisplayItem{
                showcase.NewDisplayItem(
                    "",
                    showcase.DisplayItemTypeSalesItem,
                    showcase.DisplayItemOptions{
                        SalesItem: &showcase.SalesItem{
                            Name: "gem_3000",
                            AcquireActions: []core.AcquireAction{
                                money.DepositByUserId(
                                    "namespace-0001",
                                    0,
                                    100,
                                    1,
                                ),
                            },
                            Metadata: pointy.String("GEM_3000"),
                            ConsumeActions: []core.ConsumeAction{
                                money.RecordReceipt(
                                    "namespace-0001",
                                    "contentsId-0001",
                                    "#{receipt}",
                                ),
                            },
                        },
                    },
                ),
                showcase.NewDisplayItem(
                    "",
                    showcase.DisplayItemTypeSalesItemGroup,
                    showcase.DisplayItemOptions{
                        SalesItemGroup: &showcase.SalesItemGroup{
                            Name: "step_gem",
                            SalesItems: []showcase.SalesItem{
                                showcase.NewSalesItem(
                                    "step1_gem_1000",
                                    []core.AcquireAction{
                                        money.DepositByUserId(
                                            "namespace-0001",
                                            0,
                                            100,
                                            1,
                                        ),
                                    },
                                    showcase.SalesItemOptions{
                                        Metadata: pointy.String("STEP1_GEM_1000"),
                                        ConsumeActions: []core.ConsumeAction{
                                            money.RecordReceipt(
                                                "namespace-0001",
                                                "contentsId-0001",
                                                "#{receipt}",
                                            ),
                                            limit.CountUpByUserId(
                                                "namespace-0001",
                                                "limit-0001",
                                                "counter-0001",
                                                pointy.Int32(1),
                                                pointy.Int32(100),
                                            ),
                                        },
                                    },
                                ),
                                showcase.NewSalesItem(
                                    "step2_gem_2000",
                                    []core.AcquireAction{
                                        money.DepositByUserId(
                                            "namespace-0001",
                                            0,
                                            100,
                                            1,
                                        ),
                                    },
                                    showcase.SalesItemOptions{
                                        Metadata: pointy.String("STEP1_GEM_2000"),
                                        ConsumeActions: []core.ConsumeAction{
                                            money.RecordReceipt(
                                                "namespace-0001",
                                                "contentsId-0001",
                                                "#{receipt}",
                                            ),
                                            limit.CountUpByUserId(
                                                "namespace-0001",
                                                "limit-0001",
                                                "counter-0001",
                                                pointy.Int32(1),
                                                pointy.Int32(100),
                                            ),
                                        },
                                    },
                                ),
                            },
                            Metadata: pointy.String("STEP_GEM"),
                        },
                        SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
                    },
                ),
            },
            showcase.ShowcaseOptions{
                Metadata: pointy.String("GEM"),
            },
        ),
        showcase.NewShowcase(
            "gacha",
            []showcase.DisplayItem{
                showcase.NewDisplayItem(
                    "",
                    showcase.DisplayItemTypeSalesItem,
                    showcase.DisplayItemOptions{
                        SalesItem: &showcase.SalesItem{
                            Name: "single",
                            AcquireActions: []core.AcquireAction{
                                inventory.AcquireItemSetByUserId(
                                    "namespace-0001",
                                    "inventory-0001",
                                    "item-0001",
                                    1,
                                    pointy.Int64(0),
                                    pointy.Bool(false),
                                    pointy.String(""),
                                ),
                            },
                            Metadata: pointy.String("SINGLE"),
                            ConsumeActions: []core.ConsumeAction{
                                money.WithdrawByUserId(
                                    "namespace-0001",
                                    0,
                                    1,
                                    pointy.Bool(false),
                                ),
                            },
                        },
                    },
                ),
                showcase.NewDisplayItem(
                    "",
                    showcase.DisplayItemTypeSalesItem,
                    showcase.DisplayItemOptions{
                        SalesItem: &showcase.SalesItem{
                            Name: "10times",
                            AcquireActions: []core.AcquireAction{
                                inventory.AcquireItemSetByUserId(
                                    "namespace-0001",
                                    "inventory-0001",
                                    "item-0001",
                                    1,
                                    pointy.Int64(0),
                                    pointy.Bool(false),
                                    pointy.String(""),
                                ),
                                inventory.AcquireItemSetByUserId(
                                    "namespace-0001",
                                    "inventory-0001",
                                    "item-0001",
                                    1,
                                    pointy.Int64(0),
                                    pointy.Bool(false),
                                    pointy.String(""),
                                ),
                                inventory.AcquireItemSetByUserId(
                                    "namespace-0001",
                                    "inventory-0001",
                                    "item-0001",
                                    1,
                                    pointy.Int64(0),
                                    pointy.Bool(false),
                                    pointy.String(""),
                                ),
                                inventory.AcquireItemSetByUserId(
                                    "namespace-0001",
                                    "inventory-0001",
                                    "item-0001",
                                    1,
                                    pointy.Int64(0),
                                    pointy.Bool(false),
                                    pointy.String(""),
                                ),
                                inventory.AcquireItemSetByUserId(
                                    "namespace-0001",
                                    "inventory-0001",
                                    "item-0001",
                                    1,
                                    pointy.Int64(0),
                                    pointy.Bool(false),
                                    pointy.String(""),
                                ),
                            },
                            Metadata: pointy.String("10TIMES"),
                            ConsumeActions: []core.ConsumeAction{
                                money.WithdrawByUserId(
                                    "namespace-0001",
                                    0,
                                    1,
                                    pointy.Bool(false),
                                ),
                            },
                        },
                    },
                ),
            },
            showcase.ShowcaseOptions{
                Metadata: pointy.String("GACHA"),
            },
        ),
    },
    []showcase.RandomShowcase{
    },
)

println(SampleStack.Yaml())  // Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        (new \Gs2Cdk\Showcase\Model\Namespace_(
            stack: $this,
            name: "namespace-0001"
        ))->masterData(
            [
                new \Gs2Cdk\Showcase\Model\Showcase(
                    name:"gem",
                    displayItems:[
                        new \Gs2Cdk\Showcase\Model\DisplayItem(
                            displayItemId: "",
                            type: \Gs2Cdk\Showcase\Model\Enums\DisplayItemType::SALES_ITEM,
                            options: new \Gs2Cdk\Showcase\Model\Options\DisplayItemOptions(
                                salesItem: new \Gs2Cdk\Showcase\Model\SalesItem(
                                    name: "gem_3000",
                                    acquireActions: [
                                        new \Gs2Cdk\Money\StampSheet\DepositByUserId(
                                            namespaceName: "namespace-0001",
                                            slot: 0,
                                            price: 100,
                                            count: 1,
                                            userId: "#{userId}"
                                        ),
                                    ],
                                    options: new \Gs2Cdk\Showcase\Model\Options\SalesItemOptions(
                                        metadata: "GEM_3000",
                                        consumeActions: [
                                            new \Gs2Cdk\Money\StampSheet\RecordReceipt(
                                                namespaceName: "namespace-0001",
                                                contentsId: "contentsId-0001",
                                                receipt: "#{receipt}",
                                                userId: "#{userId}"
                                            ),
                                        ],
                                    ),
                                ),
                            ),
                        ),
                        new \Gs2Cdk\Showcase\Model\DisplayItem(
                            displayItemId: "",
                            type: \Gs2Cdk\Showcase\Model\Enums\DisplayItemType::SALES_ITEM_GROUP,
                            options: new \Gs2Cdk\Showcase\Model\Options\DisplayItemOptions(
                                salesItemGroup: new \Gs2Cdk\Showcase\Model\SalesItemGroup(
                                    name: "step_gem",
                                    salesItems: [
                                        new \Gs2Cdk\Showcase\Model\SalesItem(
                                            name: "step1_gem_1000",
                                            acquireActions: [
                                                new \Gs2Cdk\Money\StampSheet\DepositByUserId(
                                                    namespaceName: "namespace-0001",
                                                    slot: 0,
                                                    price: 100,
                                                    count: 1,
                                                    userId: "#{userId}"
                                                ),
                                            ],
                                            options: new \Gs2Cdk\Showcase\Model\Options\SalesItemOptions(
                                                metadata: "STEP1_GEM_1000",
                                                consumeActions: [
                                                    new \Gs2Cdk\Money\StampSheet\RecordReceipt(
                                                        namespaceName: "namespace-0001",
                                                        contentsId: "contentsId-0001",
                                                        receipt: "#{receipt}",
                                                        userId: "#{userId}"
                                                    ),
                                                    new \Gs2Cdk\Limit\StampSheet\CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        maxValue: 100,
                                                        userId: "#{userId}"
                                                    ),
                                                ],
                                            ),
                                        ),
                                        new \Gs2Cdk\Showcase\Model\SalesItem(
                                            name: "step2_gem_2000",
                                            acquireActions: [
                                                new \Gs2Cdk\Money\StampSheet\DepositByUserId(
                                                    namespaceName: "namespace-0001",
                                                    slot: 0,
                                                    price: 100,
                                                    count: 1,
                                                    userId: "#{userId}"
                                                ),
                                            ],
                                            options: new \Gs2Cdk\Showcase\Model\Options\SalesItemOptions(
                                                metadata: "STEP1_GEM_2000",
                                                consumeActions: [
                                                    new \Gs2Cdk\Money\StampSheet\RecordReceipt(
                                                        namespaceName: "namespace-0001",
                                                        contentsId: "contentsId-0001",
                                                        receipt: "#{receipt}",
                                                        userId: "#{userId}"
                                                    ),
                                                    new \Gs2Cdk\Limit\StampSheet\CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        maxValue: 100,
                                                        userId: "#{userId}"
                                                    ),
                                                ],
                                            ),
                                        ),
                                    ],
                                    options: new \Gs2Cdk\Showcase\Model\Options\SalesItemGroupOptions(
                                        metadata: "STEP_GEM",
                                    ),
                                ),
                                salesPeriodEventId: "grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",
                            ),
                        ),
                    ],
                    options: new \Gs2Cdk\Showcase\Model\Options\ShowcaseOptions(
                        metadata:"GEM"
                    )
                ),
                new \Gs2Cdk\Showcase\Model\Showcase(
                    name:"gacha",
                    displayItems:[
                        new \Gs2Cdk\Showcase\Model\DisplayItem(
                            displayItemId: "",
                            type: \Gs2Cdk\Showcase\Model\Enums\DisplayItemType::SALES_ITEM,
                            options: new \Gs2Cdk\Showcase\Model\Options\DisplayItemOptions(
                                salesItem: new \Gs2Cdk\Showcase\Model\SalesItem(
                                    name: "single",
                                    acquireActions: [
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                    ],
                                    options: new \Gs2Cdk\Showcase\Model\Options\SalesItemOptions(
                                        metadata: "SINGLE",
                                        consumeActions: [
                                            new \Gs2Cdk\Money\StampSheet\WithdrawByUserId(
                                                namespaceName: "namespace-0001",
                                                slot: 0,
                                                count: 1,
                                                paidOnly: false,
                                                userId: "#{userId}"
                                            ),
                                        ],
                                    ),
                                ),
                            ),
                        ),
                        new \Gs2Cdk\Showcase\Model\DisplayItem(
                            displayItemId: "",
                            type: \Gs2Cdk\Showcase\Model\Enums\DisplayItemType::SALES_ITEM,
                            options: new \Gs2Cdk\Showcase\Model\Options\DisplayItemOptions(
                                salesItem: new \Gs2Cdk\Showcase\Model\SalesItem(
                                    name: "10times",
                                    acquireActions: [
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                    ],
                                    options: new \Gs2Cdk\Showcase\Model\Options\SalesItemOptions(
                                        metadata: "10TIMES",
                                        consumeActions: [
                                            new \Gs2Cdk\Money\StampSheet\WithdrawByUserId(
                                                namespaceName: "namespace-0001",
                                                slot: 0,
                                                count: 1,
                                                paidOnly: false,
                                                userId: "#{userId}"
                                            ),
                                        ],
                                    ),
                                ),
                            ),
                        ),
                    ],
                    options: new \Gs2Cdk\Showcase\Model\Options\ShowcaseOptions(
                        metadata:"GACHA"
                    )
                )
            ],
            [
            ]
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.showcase.model.Namespace(
            this,
            "namespace-0001"
        ).masterData(
            Arrays.asList(
                new io.gs2.cdk.showcase.model.Showcase(
                    "gem",
                    Arrays.asList(
                        new io.gs2.cdk.showcase.model.DisplayItem(
                            "",
                            io.gs2.cdk.showcase.model.enums.DisplayItemType.SALES_ITEM,
                            new io.gs2.cdk.showcase.model.options.DisplayItemOptions()
                                .withSalesItem(new io.gs2.cdk.showcase.model.SalesItem(
                                    "gem_3000",
                                    Arrays.asList(
                                        new io.gs2.cdk.money.stampSheet.DepositByUserId(
                                            "namespace-0001",
                                            0,
                                            100f,
                                            1,
                                            "#{userId}"
                                        )
                                    ),
                                    new io.gs2.cdk.showcase.model.options.SalesItemOptions()
                                        .withMetadata("GEM_3000")
                                        .withConsumeActions(Arrays.asList(
                                            new io.gs2.cdk.money.stampSheet.RecordReceipt(
                                                "namespace-0001",
                                                "contentsId-0001",
                                                "#{receipt}",
                                                "#{userId}"
                                            )
                                        ))
                                ))
                        ),
                        new io.gs2.cdk.showcase.model.DisplayItem(
                            "",
                            io.gs2.cdk.showcase.model.enums.DisplayItemType.SALES_ITEM_GROUP,
                            new io.gs2.cdk.showcase.model.options.DisplayItemOptions()
                                .withSalesItemGroup(new io.gs2.cdk.showcase.model.SalesItemGroup(
                                    "step_gem",
                                    Arrays.asList(
                                        new io.gs2.cdk.showcase.model.SalesItem(
                                            "step1_gem_1000",
                                            Arrays.asList(
                                                new io.gs2.cdk.money.stampSheet.DepositByUserId(
                                                    "namespace-0001",
                                                    0,
                                                    100f,
                                                    1,
                                                    "#{userId}"
                                                )
                                            ),
                                            new io.gs2.cdk.showcase.model.options.SalesItemOptions()
                                                .withMetadata("STEP1_GEM_1000")
                                                .withConsumeActions(Arrays.asList(
                                                    new io.gs2.cdk.money.stampSheet.RecordReceipt(
                                                        "namespace-0001",
                                                        "contentsId-0001",
                                                        "#{receipt}",
                                                        "#{userId}"
                                                    ),
                                                    new io.gs2.cdk.limit.stampSheet.CountUpByUserId(
                                                        "namespace-0001",
                                                        "limit-0001",
                                                        "counter-0001",
                                                        1,
                                                        100,
                                                        "#{userId}"
                                                    )
                                                ))
                                        ),
                                        new io.gs2.cdk.showcase.model.SalesItem(
                                            "step2_gem_2000",
                                            Arrays.asList(
                                                new io.gs2.cdk.money.stampSheet.DepositByUserId(
                                                    "namespace-0001",
                                                    0,
                                                    100f,
                                                    1,
                                                    "#{userId}"
                                                )
                                            ),
                                            new io.gs2.cdk.showcase.model.options.SalesItemOptions()
                                                .withMetadata("STEP1_GEM_2000")
                                                .withConsumeActions(Arrays.asList(
                                                    new io.gs2.cdk.money.stampSheet.RecordReceipt(
                                                        "namespace-0001",
                                                        "contentsId-0001",
                                                        "#{receipt}",
                                                        "#{userId}"
                                                    ),
                                                    new io.gs2.cdk.limit.stampSheet.CountUpByUserId(
                                                        "namespace-0001",
                                                        "limit-0001",
                                                        "counter-0001",
                                                        1,
                                                        100,
                                                        "#{userId}"
                                                    )
                                                ))
                                        )
                                    ),
                                    new io.gs2.cdk.showcase.model.options.SalesItemGroupOptions()
                                        .withMetadata("STEP_GEM")
                                ))
                                .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
                        )
                    ),
                    new io.gs2.cdk.showcase.model.options.ShowcaseOptions()
                        .withMetadata("GEM")
                ),
                new io.gs2.cdk.showcase.model.Showcase(
                    "gacha",
                    Arrays.asList(
                        new io.gs2.cdk.showcase.model.DisplayItem(
                            "",
                            io.gs2.cdk.showcase.model.enums.DisplayItemType.SALES_ITEM,
                            new io.gs2.cdk.showcase.model.options.DisplayItemOptions()
                                .withSalesItem(new io.gs2.cdk.showcase.model.SalesItem(
                                    "single",
                                    Arrays.asList(
                                        new io.gs2.cdk.inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1L,
                                            0L,
                                            false,
                                            "",
                                            "#{userId}"
                                        )
                                    ),
                                    new io.gs2.cdk.showcase.model.options.SalesItemOptions()
                                        .withMetadata("SINGLE")
                                        .withConsumeActions(Arrays.asList(
                                            new io.gs2.cdk.money.stampSheet.WithdrawByUserId(
                                                "namespace-0001",
                                                0,
                                                1,
                                                false,
                                                "#{userId}"
                                            )
                                        ))
                                ))
                        ),
                        new io.gs2.cdk.showcase.model.DisplayItem(
                            "",
                            io.gs2.cdk.showcase.model.enums.DisplayItemType.SALES_ITEM,
                            new io.gs2.cdk.showcase.model.options.DisplayItemOptions()
                                .withSalesItem(new io.gs2.cdk.showcase.model.SalesItem(
                                    "10times",
                                    Arrays.asList(
                                        new io.gs2.cdk.inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1L,
                                            0L,
                                            false,
                                            "",
                                            "#{userId}"
                                        ),
                                        new io.gs2.cdk.inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1L,
                                            0L,
                                            false,
                                            "",
                                            "#{userId}"
                                        ),
                                        new io.gs2.cdk.inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1L,
                                            0L,
                                            false,
                                            "",
                                            "#{userId}"
                                        ),
                                        new io.gs2.cdk.inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1L,
                                            0L,
                                            false,
                                            "",
                                            "#{userId}"
                                        ),
                                        new io.gs2.cdk.inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1L,
                                            0L,
                                            false,
                                            "",
                                            "#{userId}"
                                        )
                                    ),
                                    new io.gs2.cdk.showcase.model.options.SalesItemOptions()
                                        .withMetadata("10TIMES")
                                        .withConsumeActions(Arrays.asList(
                                            new io.gs2.cdk.money.stampSheet.WithdrawByUserId(
                                                "namespace-0001",
                                                0,
                                                1,
                                                false,
                                                "#{userId}"
                                            )
                                        ))
                                ))
                        )
                    ),
                    new io.gs2.cdk.showcase.model.options.ShowcaseOptions()
                        .withMetadata("GACHA")
                )
            ),
            Arrays.asList(
            )
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Showcase.Model.Namespace(
            stack: this,
            name: "namespace-0001"
        ).MasterData(
            new Gs2Cdk.Gs2Showcase.Model.Showcase[] {
                new Gs2Cdk.Gs2Showcase.Model.Showcase(
                    name: "gem",
                    displayItems: new Gs2Cdk.Gs2Showcase.Model.DisplayItem[]
                    {
                        new Gs2Cdk.Gs2Showcase.Model.DisplayItem(
                            displayItemId: "",
                            type: Gs2Cdk.Gs2Showcase.Model.Enums.DisplayItemType.SalesItem,
                            options: new Gs2Cdk.Gs2Showcase.Model.Options.DisplayItemOptions
                            {
                                salesItem = new Gs2Cdk.Gs2Showcase.Model.SalesItem(
                                    name: "gem_3000",
                                    acquireActions: new Gs2Cdk.Core.Model.AcquireAction[]
                                    {
                                        new Gs2Cdk.Gs2Money.StampSheet.DepositByUserId(
                                            namespaceName: "namespace-0001",
                                            slot: 0,
                                            price: 100,
                                            count: 1,
                                            userId: "#{userId}"
                                        )
                                    },
                                    options: new Gs2Cdk.Gs2Showcase.Model.Options.SalesItemOptions
                                    {
                                        metadata = "GEM_3000",
                                        consumeActions = new Gs2Cdk.Core.Model.ConsumeAction[]
                                        {
                                            new Gs2Cdk.Gs2Money.StampSheet.RecordReceipt(
                                                namespaceName: "namespace-0001",
                                                contentsId: "contentsId-0001",
                                                receipt: "#{receipt}",
                                                userId: "#{userId}"
                                            )
                                        }
                                    }
                                )
                            }
                        ),
                        new Gs2Cdk.Gs2Showcase.Model.DisplayItem(
                            displayItemId: "",
                            type: Gs2Cdk.Gs2Showcase.Model.Enums.DisplayItemType.SalesItemGroup,
                            options: new Gs2Cdk.Gs2Showcase.Model.Options.DisplayItemOptions
                            {
                                salesItemGroup = new Gs2Cdk.Gs2Showcase.Model.SalesItemGroup(
                                    name: "step_gem",
                                    salesItems: new Gs2Cdk.Gs2Showcase.Model.SalesItem[]
                                    {
                                        new Gs2Cdk.Gs2Showcase.Model.SalesItem(
                                            name: "step1_gem_1000",
                                            acquireActions: new Gs2Cdk.Core.Model.AcquireAction[]
                                            {
                                                new Gs2Cdk.Gs2Money.StampSheet.DepositByUserId(
                                                    namespaceName: "namespace-0001",
                                                    slot: 0,
                                                    price: 100,
                                                    count: 1,
                                                    userId: "#{userId}"
                                                )
                                            },
                                            options: new Gs2Cdk.Gs2Showcase.Model.Options.SalesItemOptions
                                            {
                                                metadata = "STEP1_GEM_1000",
                                                consumeActions = new Gs2Cdk.Core.Model.ConsumeAction[]
                                                {
                                                    new Gs2Cdk.Gs2Money.StampSheet.RecordReceipt(
                                                        namespaceName: "namespace-0001",
                                                        contentsId: "contentsId-0001",
                                                        receipt: "#{receipt}",
                                                        userId: "#{userId}"
                                                    ),
                                                    new Gs2Cdk.Gs2Limit.StampSheet.CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        maxValue: 100,
                                                        userId: "#{userId}"
                                                    )
                                                }
                                            }
                                        ),
                                        new Gs2Cdk.Gs2Showcase.Model.SalesItem(
                                            name: "step2_gem_2000",
                                            acquireActions: new Gs2Cdk.Core.Model.AcquireAction[]
                                            {
                                                new Gs2Cdk.Gs2Money.StampSheet.DepositByUserId(
                                                    namespaceName: "namespace-0001",
                                                    slot: 0,
                                                    price: 100,
                                                    count: 1,
                                                    userId: "#{userId}"
                                                )
                                            },
                                            options: new Gs2Cdk.Gs2Showcase.Model.Options.SalesItemOptions
                                            {
                                                metadata = "STEP1_GEM_2000",
                                                consumeActions = new Gs2Cdk.Core.Model.ConsumeAction[]
                                                {
                                                    new Gs2Cdk.Gs2Money.StampSheet.RecordReceipt(
                                                        namespaceName: "namespace-0001",
                                                        contentsId: "contentsId-0001",
                                                        receipt: "#{receipt}",
                                                        userId: "#{userId}"
                                                    ),
                                                    new Gs2Cdk.Gs2Limit.StampSheet.CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        maxValue: 100,
                                                        userId: "#{userId}"
                                                    )
                                                }
                                            }
                                        )
                                    },
                                    options: new Gs2Cdk.Gs2Showcase.Model.Options.SalesItemGroupOptions
                                    {
                                        metadata = "STEP_GEM"
                                    }
                                ),
                                salesPeriodEventId = "grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"
                            }
                        )
                    },
                    options: new Gs2Cdk.Gs2Showcase.Model.Options.ShowcaseOptions
                    {
                        metadata = "GEM"
                    }
                ),
                new Gs2Cdk.Gs2Showcase.Model.Showcase(
                    name: "gacha",
                    displayItems: new Gs2Cdk.Gs2Showcase.Model.DisplayItem[]
                    {
                        new Gs2Cdk.Gs2Showcase.Model.DisplayItem(
                            displayItemId: "",
                            type: Gs2Cdk.Gs2Showcase.Model.Enums.DisplayItemType.SalesItem,
                            options: new Gs2Cdk.Gs2Showcase.Model.Options.DisplayItemOptions
                            {
                                salesItem = new Gs2Cdk.Gs2Showcase.Model.SalesItem(
                                    name: "single",
                                    acquireActions: new Gs2Cdk.Core.Model.AcquireAction[]
                                    {
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        )
                                    },
                                    options: new Gs2Cdk.Gs2Showcase.Model.Options.SalesItemOptions
                                    {
                                        metadata = "SINGLE",
                                        consumeActions = new Gs2Cdk.Core.Model.ConsumeAction[]
                                        {
                                            new Gs2Cdk.Gs2Money.StampSheet.WithdrawByUserId(
                                                namespaceName: "namespace-0001",
                                                slot: 0,
                                                count: 1,
                                                paidOnly: false,
                                                userId: "#{userId}"
                                            )
                                        }
                                    }
                                )
                            }
                        ),
                        new Gs2Cdk.Gs2Showcase.Model.DisplayItem(
                            displayItemId: "",
                            type: Gs2Cdk.Gs2Showcase.Model.Enums.DisplayItemType.SalesItem,
                            options: new Gs2Cdk.Gs2Showcase.Model.Options.DisplayItemOptions
                            {
                                salesItem = new Gs2Cdk.Gs2Showcase.Model.SalesItem(
                                    name: "10times",
                                    acquireActions: new Gs2Cdk.Core.Model.AcquireAction[]
                                    {
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            expiresAt: 0,
                                            createNewItemSet: false,
                                            itemSetName: "",
                                            userId: "#{userId}"
                                        ),
                                    },
                                    options: new Gs2Cdk.Gs2Showcase.Model.Options.SalesItemOptions
                                    {
                                        metadata = "10TIMES",
                                        consumeActions = new Gs2Cdk.Core.Model.ConsumeAction[]
                                        {
                                            new Gs2Cdk.Gs2Money.StampSheet.WithdrawByUserId(
                                                namespaceName: "namespace-0001",
                                                slot: 0,
                                                count: 1,
                                                paidOnly: false,
                                                userId: "#{userId}"
                                            )
                                        }
                                    }
                                )
                            }
                        )
                    },
                    options: new Gs2Cdk.Gs2Showcase.Model.Options.ShowcaseOptions
                    {
                        metadata = "GACHA"
                    }
                )
            },
            new Gs2Cdk.Gs2Showcase.Model.RandomShowcase[] {
            }
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template
import core from "@/gs2cdk/core";
import showcase from "@/gs2cdk/showcase";
import money from "@/gs2cdk/money";
import limit from "@/gs2cdk/limit";
import inventory from "@/gs2cdk/inventory";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new showcase.model.Namespace(
            this,
            "namespace-0001",
        ).masterData(
            [
                new showcase.model.Showcase(
                    "gem",
                    [
                        new showcase.model.DisplayItem(
                            "",
                            showcase.model.DisplayItemType.SALES_ITEM,
                            {
                                salesItem: new showcase.model.SalesItem(
                                    "gem_3000",
                                    [
                                        new money.stampSheet.DepositByUserId(
                                            "namespace-0001",
                                            0,
                                            100,
                                            1,
                                            null,
                                            "#{userId}"
                                        ),
                                    ],
                                    {
                                        metadata: "GEM_3000",
                                        consumeActions: [
                                            new money.stampSheet.RecordReceipt(
                                                "namespace-0001",
                                                "contentsId-0001",
                                                "#{receipt}",
                                                null,
                                                "#{userId}"
                                            ),
                                        ]
                                    }
                                )
                            }
                        ),
                        new showcase.model.DisplayItem(
                            "",
                            showcase.model.DisplayItemType.SALES_ITEM_GROUP,
                            {
                                salesItemGroup: new showcase.model.SalesItemGroup(
                                    "step_gem",
                                    [
                                        new showcase.model.SalesItem(
                                            "step1_gem_1000",
                                            [
                                                new money.stampSheet.DepositByUserId(
                                                    "namespace-0001",
                                                    0,
                                                    100,
                                                    1,
                                                    null,
                                                    "#{userId}"
                                                ),
                                            ],
                                            {
                                                metadata: "STEP1_GEM_1000",
                                                consumeActions: [
                                                    new money.stampSheet.RecordReceipt(
                                                        "namespace-0001",
                                                        "contentsId-0001",
                                                        "#{receipt}",
                                                        null,
                                                        "#{userId}"
                                                    ),
                                                    new limit.stampSheet.CountUpByUserId(
                                                        "namespace-0001",
                                                        "limit-0001",
                                                        "counter-0001",
                                                        1,
                                                        100,
                                                        null,
                                                        "#{userId}"
                                                    ),
                                                ]
                                            }
                                        ),
                                        new showcase.model.SalesItem(
                                            "step2_gem_2000",
                                            [
                                                new money.stampSheet.DepositByUserId(
                                                    "namespace-0001",
                                                    0,
                                                    100,
                                                    1,
                                                    null,
                                                    "#{userId}"
                                                ),
                                            ],
                                            {
                                                metadata: "STEP1_GEM_2000",
                                                consumeActions: [
                                                    new money.stampSheet.RecordReceipt(
                                                        "namespace-0001",
                                                        "contentsId-0001",
                                                        "#{receipt}",
                                                        null,
                                                        "#{userId}"
                                                    ),
                                                    new limit.stampSheet.CountUpByUserId(
                                                        "namespace-0001",
                                                        "limit-0001",
                                                        "counter-0001",
                                                        1,
                                                        100,
                                                        null,
                                                        "#{userId}"
                                                    ),
                                                ]
                                            }
                                        ),
                                    ],
                                    {
                                        metadata: "STEP_GEM"
                                    }
                                ),
                                salesPeriodEventId: "grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"
                            }
                        ),
                    ],
                    {
                        metadata: "GEM"
                    }
                ),
                new showcase.model.Showcase(
                    "gacha",
                    [
                        new showcase.model.DisplayItem(
                            "",
                            showcase.model.DisplayItemType.SALES_ITEM,
                            {
                                salesItem: new showcase.model.SalesItem(
                                    "single",
                                    [
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            0,
                                            false,
                                            "",
                                            null,
                                            "#{userId}"
                                        ),
                                    ],
                                    {
                                        metadata: "SINGLE",
                                        consumeActions: [
                                            new money.stampSheet.WithdrawByUserId(
                                                "namespace-0001",
                                                0,
                                                1,
                                                false,
                                                null,
                                                "#{userId}"
                                            ),
                                        ]
                                    }
                                )
                            }
                        ),
                        new showcase.model.DisplayItem(
                            "",
                            showcase.model.DisplayItemType.SALES_ITEM,
                            {
                                salesItem: new showcase.model.SalesItem(
                                    "10times",
                                    [
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            0,
                                            false,
                                            "",
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            0,
                                            false,
                                            "",
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            0,
                                            false,
                                            "",
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            0,
                                            false,
                                            "",
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            0,
                                            false,
                                            "",
                                            null,
                                            "#{userId}"
                                        ),
                                    ],
                                    {
                                        metadata: "10TIMES",
                                        consumeActions: [
                                            new money.stampSheet.WithdrawByUserId(
                                                "namespace-0001",
                                                0,
                                                1,
                                                false,
                                                null,
                                                "#{userId}"
                                            ),
                                        ]
                                    }
                                )
                            }
                        ),
                    ],
                    {
                        metadata: "GACHA"
                    }
                )
            ],
            [
            ]
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
from gs2_cdk import Stack, core, showcase, money

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        showcase.Namespace(
            stack=self,
            name="namespace-0001",
        ).master_data(
            showcases=[
                showcase.Showcase(
                    name='gem',
                    display_items=[
                        showcase.DisplayItem(
                            display_item_id= "",
                            type=showcase.DisplayItemType.SALES_ITEM,
                            options=showcase.DisplayItemOptions(
                                sales_item=showcase.SalesItem(
                                    name='gem_3000',
                                    acquire_actions=[
                                        money.DepositByUserId(
                                            namespace_name='namespace-0001',
                                            slot=0,
                                            price=100,
                                            count=1,
                                            user_id='#{userId}'
                                        ),
                                    ],
                                    options=showcase.SalesItemOptions(
                                        metadata='GEM_3000',
                                        consume_actions=[
                                            money.RecordReceipt(
                                                namespace_name='namespace-0001',
                                                contents_id='contentsId-0001',
                                                receipt='#{receipt}',
                                                user_id='#{userId}'
                                            ),
                                        ],
                                    ),
                                ),
                            ),
                        ),
                        showcase.DisplayItem(
                            display_item_id= "",
                            type=showcase.DisplayItemType.SALES_ITEM_GROUP,
                            options=showcase.DisplayItemOptions(
                                sales_item_group=showcase.SalesItemGroup(
                                    name='step_gem',
                                    sales_items=[
                                        showcase.SalesItem(
                                            name='step1_gem_1000',
                                            acquire_actions=[
                                                money.DepositByUserId(
                                                    namespace_name='namespace-0001',
                                                    slot=0,
                                                    price=100,
                                                    count=1,
                                                    user_id='#{userId}'
                                                ),
                                            ],
                                            options=showcase.SalesItemOptions(
                                                metadata='STEP1_GEM_1000',
                                                consume_actions=[
                                                    money.RecordReceipt(
                                                        namespace_name='namespace-0001',
                                                        contents_id='contentsId-0001',
                                                        receipt='#{receipt}',
                                                        user_id='#{userId}'
                                                    ),
                                                    limit.CountUpByUserId(
                                                        namespace_name='namespace-0001',
                                                        limit_name='limit-0001',
                                                        counter_name='counter-0001',
                                                        count_up_value=1,
                                                        max_value=100,
                                                        user_id='#{userId}'
                                                    ),
                                                ],
                                            ),
                                        ),
                                        showcase.SalesItem(
                                            name='step2_gem_2000',
                                            acquire_actions=[
                                                money.DepositByUserId(
                                                    namespace_name='namespace-0001',
                                                    slot=0,
                                                    price=100,
                                                    count=1,
                                                    user_id='#{userId}'
                                                ),
                                            ],
                                            options=showcase.SalesItemOptions(
                                                metadata='STEP1_GEM_2000',
                                                consume_actions=[
                                                    money.RecordReceipt(
                                                        namespace_name='namespace-0001',
                                                        contents_id='contentsId-0001',
                                                        receipt='#{receipt}',
                                                        user_id='#{userId}'
                                                    ),
                                                    limit.CountUpByUserId(
                                                        namespace_name='namespace-0001',
                                                        limit_name='limit-0001',
                                                        counter_name='counter-0001',
                                                        count_up_value=1,
                                                        max_value=100,
                                                        user_id='#{userId}'
                                                    ),
                                                ],
                                            ),
                                        ),
                                    ],
                                    options=showcase.SalesItemGroupOptions(
                                        metadata='STEP_GEM',
                                    ),
                                ),
                                sales_period_event_id='grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001',
                            ),
                        ),
                    ],
                    options=showcase.ShowcaseOptions(
                        metadata = 'GEM'
                    ),
                ),
                showcase.Showcase(
                    name='gacha',
                    display_items=[
                        showcase.DisplayItem(
                            display_item_id= "",
                            type=showcase.DisplayItemType.SALES_ITEM,
                            options=showcase.DisplayItemOptions(
                                sales_item=showcase.SalesItem(
                                    name='single',
                                    acquire_actions=[
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            expires_at=0,
                                            create_new_item_set=False,
                                            item_set_name="",
                                            user_id='#{userId}'
                                        ),
                                    ],
                                    options=showcase.SalesItemOptions(
                                        metadata='SINGLE',
                                        consume_actions=[
                                            money.WithdrawByUserId(
                                                namespace_name='namespace-0001',
                                                slot=0,
                                                count=1,
                                                paid_only=False,
                                                user_id='#{userId}'
                                            ),
                                        ],
                                    ),
                                ),
                            ),
                        ),
                        showcase.DisplayItem(
                            display_item_id= "",
                            type=showcase.DisplayItemType.SALES_ITEM,
                            options=showcase.DisplayItemOptions(
                                sales_item=showcase.SalesItem(
                                    name='10times',
                                    acquire_actions=[
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            expires_at=0,
                                            create_new_item_set=False,
                                            item_set_name="",
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            expires_at=0,
                                            create_new_item_set=False,
                                            item_set_name="",
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            expires_at=0,
                                            create_new_item_set=False,
                                            item_set_name="",
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            expires_at=0,
                                            create_new_item_set=False,
                                            item_set_name="",
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            expires_at=0,
                                            create_new_item_set=False,
                                            item_set_name="",
                                            user_id='#{userId}'
                                        ),
                                    ],
                                    options=showcase.SalesItemOptions(
                                        metadata='10TIMES',
                                        consume_actions=[
                                            money.WithdrawByUserId(
                                                namespace_name='namespace-0001',
                                                slot=0,
                                                count=1,
                                                paid_only=False,
                                                user_id='#{userId}'
                                            ),
                                        ],
                                    ),
                                ),
                            ),
                        ),
                    ],
                    options=showcase.ShowcaseOptions(
                        metadata = 'GACHA'
                    ),
                ),
            ],
            random_showcases=[
            ],
        )

print(SampleStack().yaml())  # Generate Template

Showcase

진열대

진열대에는 진열할 상품을 정의할 수 있습니다.
또한 진열대의 상품 판매 기간을 설정할 수 있습니다.

타입활성화 조건필수기본값값 제한설명
showcaseIdstring
~ 1024자진열대 GRN
※ 서버가 자동으로 설정
namestring
~ 128자진열대 이름
진열대 고유의 이름. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다.
metadatastring~ 2048자메타데이터
메타데이터에는 임의의 값을 설정할 수 있습니다.
이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다.
salesPeriodEventIdstring~ 1024자진열대의 판매 기간을 설정한 GS2-Schedule 이벤트 GRN
이 진열대 전체의 판매 기간을 제어합니다. 지정한 경우, 연관된 GS2-Schedule 이벤트 기간 중에만 진열대를 이용할 수 있습니다. 이벤트가 유효하지 않은 경우, 진열대는 비어 있는 상태로 반환됩니다.
displayItemsList<DisplayItem>[]1 ~ 1000 items진열할 상품 리스트
이 진열대에 진열되는 상품의 리스트입니다. 각 진열 상품은 단일 상품 또는 상품 그룹 중 하나입니다. 판매 기간 이벤트가 종료되었거나 유효하지 않은 상품은 진열대 조회 시 자동으로 필터링됩니다.

DisplayItem

진열 상품

스탠다드 진열대에 진열되는 상품입니다.
진열대에 정의한 진열 상품은 모두 진열됩니다. 랜덤 진열대의 경우에는 대신 RandomDisplayItemModel 을 사용합니다.

type 으로 진열 상품이 무엇을 참조할지를 선택합니다.
salesItem 은 고정된 대가와 보상을 가진 단일 상품을 참조합니다.
salesItemGroup 은 상품 그룹을 참조하며, 그룹에 소속된 상품을 앞에서부터 순서대로 구매 가능한지 판정하여 가장 먼저 구매 가능하다고 판정된 상품이 진열됩니다.
초회 한정 할인 상품이나, 단계별 가챠처럼 구매 횟수에 따라 내용이 변화하는 구조에는 상품 그룹을 사용합니다.

salesPeriodEventId 에 GS2-Schedule 의 이벤트를 지정하면, 해당 이벤트 기간 중에만 이 상품이 진열됩니다.
진열대 자체에 설정한 판매 기간과는 독립적으로 동작하므로, 하나의 진열대 안에 상설 상품과 이벤트 기간 한정 상품을 함께 둘 수 있습니다.

displayItemId 에는 진열대 안에서 고유한 이름을 보관합니다. 생략한 경우에는 시스템이 UUID 형식으로 자동 할당합니다.

타입활성화 조건필수기본값값 제한설명
displayItemIdstring
UUID~ 128자진열 상품 ID
진열 상품의 고유한 이름을 유지합니다.
생략하면 시스템에 의해 UUID(Universally Unique Identifier) 형식으로 자동 할당됩니다.
type문자열 열거형
enum {
  “salesItem”,
  “salesItemGroup”
}
종류
표시할 상품의 종류입니다. salesItem은 고정된 대가와 보상을 가진 단일 상품입니다. salesItemGroup은 여러 상품을 순서대로 평가하는 상품 그룹으로, 단계별 가격 인상이나 초회 한정 할인 등에 사용됩니다.
정의설명
salesItem상품
salesItemGroup상품 그룹
salesItemSalesItem{type} == “salesItem”
✓※
상품
※ type이(가) “salesItem” 이면 필수
salesItemGroupSalesItemGroup{type} == “salesItemGroup”
✓※
상품 그룹
※ type이(가) “salesItemGroup” 이면 필수
salesPeriodEventIdstring~ 1024자이 진열 상품의 판매 기간을 설정한 GS2-Schedule의 이벤트 GRN
이 개별 진열 상품의 판매 기간을 제어합니다. 지정한 경우, 관련된 GS2-Schedule의 이벤트 기간 중에만 진열대에 표시됩니다. 진열대 전체의 판매 기간과는 독립적으로 동작합니다.

SalesItem

상품

상품을 구매하기 위해 필요한 대가와, 상품을 구매했을 때 얻을 수 있는 보상을 설정합니다.

타입활성화 조건필수기본값값 제한설명
namestring
~ 128자상품 이름
상품 고유의 이름. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다.
metadatastring~ 2048자메타데이터
메타데이터에는 임의의 값을 설정할 수 있습니다.
이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다.
verifyActionsList<VerifyAction>[]0 ~ 10 items검증 액션 리스트
구매 전에 실행되는 전제 조건 체크입니다. 모든 검증 액션이 성공한 후에 소비·획득 액션이 처리됩니다. 구매 자격 조건 체크에 사용할 수 있습니다.
consumeActionsList<ConsumeAction>[]0 ~ 10 items소비 액션 리스트
구매 대가로 리소스를 소비하는 액션입니다. 상품 그룹의 구매 횟수 제어를 위해 GS2-Limit의 CountUp 액션을 포함할 수 있습니다.
acquireActionsList<AcquireAction>[]1 ~ 100 items획득 액션 리스트
구매 보상으로 리소스를 부여하는 액션입니다. 모든 소비 액션이 정상적으로 완료된 후에 실행됩니다.

SalesItemGroup

상품 그룹

상품 그룹은 진열대에 진열하기 위한 엔티티입니다.
상품 그룹에는 여러 상품을 소속시킬 수 있으며, 소속된 상품의 앞에서부터 순서대로 구매 가능한지를 판정하여 가장 먼저 구매 가능하다고 판정된 상품이 실제로 진열됩니다.
최초 1회만 할인되는 상품이나, 스텝업 가챠처럼 구매 횟수에 따라 상품 내용이 변화하는 구조에 사용할 수 있습니다.

타입활성화 조건필수기본값값 제한설명
namestring
~ 128자상품 그룹 이름
상품 그룹 고유의 이름. 영숫자 및 -(하이픈), _(언더스코어), .(마침표)로 지정합니다.
metadatastring~ 2048자메타데이터
메타데이터에는 임의의 값을 설정할 수 있습니다.
이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다.
salesItemsList<SalesItem>[]2 ~ 10 items상품 그룹에 포함할 상품
이 그룹 내 상품의 순서가 지정된 리스트입니다. GS2-Limit 카운터를 사용하여 앞에서부터 순서대로 구매 가능한지를 판정하고, 가장 먼저 구매 가능하다고 판정된 상품이 표시됩니다. 어느 것도 해당하지 않는 경우, 리스트의 마지막 상품이 폴백으로 사용됩니다.

RandomShowcase

랜덤 진열대

랜덤 진열대는 지정한 주기로 교체되는, 랜덤으로 선별된 상품이 진열되는 진열대 모델입니다.

선별되는 상품은 상품 풀에 등록된 상품 중에서 지정된 수량이 상품별로 설정된 가중치에 기반하여 랜덤으로 선택됩니다.
랜덤 진열대에는 GS2-Schedule의 이벤트를 연결하여 판매 기간을 설정할 수 있습니다.

타입활성화 조건필수기본값값 제한설명
randomShowcaseIdstring
~ 1024자랜덤 진열대 GRN
※ 서버가 자동으로 설정
namestring
~ 128자랜덤 진열대 이름
랜덤 진열대 고유의 이름. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다.
metadatastring~ 2048자메타데이터
메타데이터에는 임의의 값을 설정할 수 있습니다.
이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다.
maximumNumberOfChoiceint
1 ~ 100선택되는 상품의 최대 수
각 로테이션 기간마다 상품 풀에서 랜덤으로 추첨되는 상품의 수입니다. 가중치 기반 랜덤 선택으로 중복 없이 추첨되므로, 한 번의 로테이션에서 같은 상품이 두 번 표시되는 일은 없습니다.
displayItemsList<RandomDisplayItemModel>[]1 ~ 100 items선택 대상 진열 상품 목록
상품이 랜덤으로 추첨되는 후보 아이템의 풀입니다. 각 아이템에는 선택 확률을 결정하는 가중치와, 로테이션 전체에서 표시 가능한 횟수를 제한하는 재고 수가 있습니다.
baseTimestamplong
진열 상품 재추첨 기준 시간
로테이션 경계 계산에 사용되는 기준 타임스탬프입니다. 이 기준 시간으로부터 일정 간격(resetIntervalHours)마다 상품의 재추첨이 이루어집니다. 과거 시각을 지정해야 합니다.
resetIntervalHoursint
1 ~ 168진열 상품을 재추첨하는 간격(시간)
각 상품 로테이션 사이의 시간 수입니다. baseTimestamp를 기준으로 간격이 경과하면 새로운 난수 시드로 진열 상품이 재추첨됩니다. 1~168시간(1주일) 범위에서 설정할 수 있습니다.
salesPeriodEventIdstring~ 1024자진열대의 판매 기간을 설정한 GS2-Schedule의 이벤트 GRN
이 랜덤 진열대 전체의 판매 기간을 제어합니다. 지정한 경우, 관련된 GS2-Schedule의 이벤트 기간 중에만 진열대를 이용할 수 있습니다.

RandomDisplayItemModel

랜덤 진열대에 진열 가능한 상품

weight에 상품을 선별하는 확률을 설정할 수 있습니다.

타입활성화 조건필수기본값값 제한설명
namestring
UUID~ 128자랜덤 진열 상품 ID
랜덤 진열 상품의 고유한 이름을 유지합니다.
생략하면 시스템에 의해 UUID(Universally Unique Identifier) 형식으로 자동 할당됩니다.
metadatastring~ 2048자메타데이터
메타데이터에는 임의의 값을 설정할 수 있습니다.
이 값들은 GS2의 동작에는 영향을 주지 않으므로, 게임 내에서 사용하는 정보를 저장하는 용도로 사용할 수 있습니다.
verifyActionsList<VerifyAction>[]0 ~ 10 items검증 액션 목록
이 랜덤 진열 상품을 구매하기 전에 실행되는 전제 조건 확인입니다. 모든 검증 액션이 성공한 후에 소비·획득 액션이 처리됩니다.
consumeActionsList<ConsumeAction>[]0 ~ 10 items소비 액션 목록
이 랜덤 진열 상품의 구매 대가로 리소스를 소비하는 액션입니다. 트랜잭션의 소비 액션으로 실행됩니다.
acquireActionsList<AcquireAction>[]1 ~ 100 items획득 액션 목록
이 랜덤 진열 상품의 구매 보상으로 리소스를 지급하는 액션입니다. 트랜잭션의 획득 액션으로 실행됩니다.
stockint
1 ~ 2147483646재고 수
모든 로테이션을 통틀어 이 상품이 추첨될 수 있는 최대 횟수입니다. 재고가 0이 되면 이후 추첨에서 제외됩니다. 로테이션 추첨 시 상품이 선택되면 재고가 소비됩니다.
weightint
1 ~ 2147483646추첨 가중치
랜덤 선택에서 이 상품의 상대적인 확률 가중치입니다. 가중치가 클수록 추첨될 확률이 높아집니다. 실제 선택 확률은 이 상품의 가중치를 대상이 되는 모든 상품의 가중치 합계로 나눈 값으로 계산됩니다.

ConsumeAction

소비 액션

타입활성화 조건필수기본값값 제한설명
action문자열 열거형
enum {
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Mission:ResetCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
소비 액션에서 실행할 액션의 종류
requeststring
~ 524288자액션 실행 시 사용되는 요청의 JSON 문자열

VerifyAction

검증 액션

타입활성화 조건필수기본값값 제한설명
action문자열 열거형
enum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
"Gs2Stamina:VerifyStaminaValueByUserId",
"Gs2Stamina:VerifyStaminaMaxValueByUserId",
"Gs2Stamina:VerifyStaminaRecoverIntervalMinutesByUserId",
"Gs2Stamina:VerifyStaminaRecoverValueByUserId",
"Gs2Stamina:VerifyStaminaOverflowValueByUserId",
}
검증 액션에서 실행할 액션의 종류
requeststring
~ 524288자액션 실행 시 사용되는 요청의 JSON 문자열

AcquireAction

입수 액션

타입활성화 조건필수기본값값 제한설명
action문자열 열거형
enum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
입수 액션에서 실행할 액션의 종류
requeststring
~ 524288자액션 실행 시 사용되는 요청의 JSON 문자열