GS2-Deploy/CDK Reference of GS2-Showcase

Template format used to create GS2-Deploy stacks and examples of template output implementation in various languages using CDK

Entities

Namespace

Namespace

A namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a namespace before you can start using each service.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSetting
Transaction settings
buyScriptScriptSettingScript to run when attempting to execute a purchase
logSettingLogSettingLog output settings

GetAttr

Generation results of resources that can be obtained with the !GetAttr tag

TypeDescription
ItemNamespaceNamespace created

Implementation Example

Type: GS2::Showcase::Namespace
Properties:
  Name: namespace-0001
  Description: null
  TransactionSetting: 
    EnableAutoRun: true
    QueueNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001
  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"
    "github.com/gs2io/gs2-golang-cdk/money"
    "github.com/openlyinc/pointy"
)

SampleStack := core.NewStack()
showcase.NewNamespace(
    &SampleStack,
    "namespace-0001",
    showcase.NamespaceOptions{
        TransactionSetting: core.NewTransactionSetting(
            core.TransactionSettingOptions{
                QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
            },
        ),
        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(
                transactionSetting: new \Gs2Cdk\Core\Model\TransactionSetting(
                    new \Gs2Cdk\Core\Model\TransactionSettingOptions(
                        queueNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
                    )
                ),
                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()
                        .withTransactionSetting(new io.gs2.cdk.core.model.TransactionSetting(
                            new io.gs2.cdk.core.model.options.TransactionSettingOptions()
                                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                        ))
                        .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
            {
                transactionSetting = new Gs2Cdk.Core.Model.TransactionSetting(
                    options: new Gs2Cdk.Core.Model.TransactionSettingOptions
                    {
                        queueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
                    }
                ),
                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",
            {
                transactionSetting: new core.TransactionSetting(
                    {
                        queueNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-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(
                transaction_setting=core.TransactionSetting(
                    options=core.TransactionSettingOptions(
                        queue_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001',
                    )
                ),
                log_setting=core.LogSetting(
                    logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
                ),
            ),
        )

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

CurrentShowcaseMaster

Currently Available Master Data

GS2 uses JSON format files for managing master data. By uploading these files, the settings are applied to the server.

To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for operating your game and export JSON files in the appropriate format.

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
modeString Enum
enum {
  “direct”,
  “preUpload”
}
“direct”~ 128 charsUpdate mode
Enumerator String DefinitionDescription
“direct”Directly update the settings
“preUpload”Upload the settings and then update
settingsstring{mode} == “direct”
✓*
~ 5242880 charsMaster Data
* Required if mode is “direct”
uploadTokenstring{mode} == “preUpload”
✓*
~ 1024 charsToken used to reflect results after upload
* Required if mode is “preUpload”

GetAttr

Generation results of resources that can be obtained with the !GetAttr tag

TypeDescription
ItemCurrentShowcaseMasterUpdated and currently available showcase master

Implementation Example

Type: GS2::Showcase::CurrentShowcaseMaster
Properties:
  NamespaceName: namespace-0001
  Mode: null
  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": "",
                    "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": "",
                        "userId": "#{userId}"
                      }
                    },
                    {
                      "action": "Gs2Limit:CountUpByUserId",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "limitName": "limit-0001",
                        "counterName": "counter-0001",
                        "countUpValue": 1,
                        "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": "",
                        "userId": "#{userId}"
                      }
                    },
                    {
                      "action": "Gs2Limit:CountUpByUserId",
                      "request": {
                        "namespaceName": "namespace-0001",
                        "limitName": "limit-0001",
                        "counterName": "counter-0001",
                        "countUpValue": 1,
                        "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,
                    "expireAt": null,
                    "createNewItemSet": false,
                    "itemSetName": null
                  }
                }
              ]
              }
          },
          {
            "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,
                    "expireAt": null,
                    "createNewItemSet": false,
                    "itemSetName": null
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expireAt": null,
                    "createNewItemSet": false,
                    "itemSetName": null
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expireAt": null,
                    "createNewItemSet": false,
                    "itemSetName": null
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expireAt": null,
                    "createNewItemSet": false,
                    "itemSetName": null
                  }
                },
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": {
                    "namespaceName": "namespace-0001",
                    "inventoryName": "inventory-0001",
                    "itemName": "item-0001",
                    "acquireCount": 1,
                    "expireAt": null,
                    "createNewItemSet": false,
                    "itemSetName": null
                  }
                }
              ]
              }
          }
        ],
        "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/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{
                            Metadata: pointy.String("GEM_3000"),
                            ConsumeActions: []core.ConsumeAction{
                                money.RecordReceipt(
                                    "namespace-0001",
                                    "contentsId-0001",
                                    "",
                                ),
                            },
                        },
                    },
                ),
                showcase.NewDisplayItem(
                    "",
                    showcase.DisplayItemTypeSalesItemGroup,
                    showcase.DisplayItemOptions{
                        SalesItemGroup: &showcase.SalesItemGroup{
                            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{
                            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{
                            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: "",
                                                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: "",
                                                        userId: "#{userId}"
                                                    ),
                                                    new \Gs2Cdk\Limit\StampSheet\CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        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: "",
                                                        userId: "#{userId}"
                                                    ),
                                                    new \Gs2Cdk\Limit\StampSheet\CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        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,
                                            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,
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            userId: "#{userId}"
                                        ),
                                        new \Gs2Cdk\Inventory\StampSheet\AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            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",
                                                "",
                                                "#{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",
                                                        "",
                                                        "#{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",
                                                        "",
                                                        "#{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: "",
                                                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: "",
                                                        userId: "#{userId}"
                                                    ),
                                                    new Gs2Cdk.Gs2Limit.StampSheet.CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        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: "",
                                                        userId: "#{userId}"
                                                    ),
                                                    new Gs2Cdk.Gs2Limit.StampSheet.CountUpByUserId(
                                                        namespaceName: "namespace-0001",
                                                        limitName: "limit-0001",
                                                        counterName: "counter-0001",
                                                        countUpValue: 1,
                                                        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,
                                            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,
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            userId: "#{userId}"
                                        ),
                                        new Gs2Cdk.Gs2Inventory.StampSheet.AcquireItemSetByUserId(
                                            namespaceName: "namespace-0001",
                                            inventoryName: "inventory-0001",
                                            itemName: "item-0001",
                                            acquireCount: 1,
                                            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";

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,
                                            "#{userId}"
                                        ),
                                    ],
                                    {
                                        metadata: "GEM_3000",
                                        consumeActions: [
                                            new money.stampSheet.RecordReceipt(
                                                "namespace-0001",
                                                "contentsId-0001",
                                                "",
                                                "#{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,
                                                    "#{userId}"
                                                ),
                                            ],
                                            {
                                                metadata: "STEP1_GEM_1000",
                                                consumeActions: [
                                                    new money.stampSheet.RecordReceipt(
                                                        "namespace-0001",
                                                        "contentsId-0001",
                                                        "",
                                                        "#{userId}"
                                                    ),
                                                    new limit.stampSheet.CountUpByUserId(
                                                        "namespace-0001",
                                                        "limit-0001",
                                                        "counter-0001",
                                                        1,
                                                        null,
                                                        null,
                                                        "#{userId}"
                                                    ),
                                                ]
                                            }
                                        ),
                                        new showcase.model.SalesItem(
                                            "step2_gem_2000",
                                            [
                                                new money.stampSheet.DepositByUserId(
                                                    "namespace-0001",
                                                    0,
                                                    100,
                                                    1,
                                                    "#{userId}"
                                                ),
                                            ],
                                            {
                                                metadata: "STEP1_GEM_2000",
                                                consumeActions: [
                                                    new money.stampSheet.RecordReceipt(
                                                        "namespace-0001",
                                                        "contentsId-0001",
                                                        "",
                                                        "#{userId}"
                                                    ),
                                                    new limit.stampSheet.CountUpByUserId(
                                                        "namespace-0001",
                                                        "limit-0001",
                                                        "counter-0001",
                                                        1,
                                                        null,
                                                        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,
                                            null,
                                            null,
                                            "#{userId}"
                                        ),
                                    ],
                                    {
                                        metadata: "SINGLE",
                                        consumeActions: [
                                            new money.stampSheet.WithdrawByUserId(
                                                "namespace-0001",
                                                0,
                                                1,
                                                false,
                                                "#{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,
                                            null,
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            null,
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            null,
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            null,
                                            null,
                                            "#{userId}"
                                        ),
                                        new inventory.stampSheet.AcquireItemSetByUserId(
                                            "namespace-0001",
                                            "inventory-0001",
                                            "item-0001",
                                            1,
                                            null,
                                            null,
                                            "#{userId}"
                                        ),
                                    ],
                                    {
                                        metadata: "10TIMES",
                                        consumeActions: [
                                            new money.stampSheet.WithdrawByUserId(
                                                "namespace-0001",
                                                0,
                                                1,
                                                false,
                                                "#{userId}"
                                            ),
                                        ]
                                    }
                                )
                            }
                        ),
                    ],
                    {
                        metadata: "GACHA"
                    }
                )
            ],
            [
            ]
        );
    }
}

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",
        ).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="",
                                                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="",
                                                        user_id='#{userId}'
                                                    ),
                                                    limit.CountUpByUserId(
                                                        namespace_name='namespace-0001',
                                                        limit_name='limit-0001',
                                                        counter_name='counter-0001',
                                                        count_up_value=1,
                                                        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="",
                                                        user_id='#{userId}'
                                                    ),
                                                    limit.CountUpByUserId(
                                                        namespace_name='namespace-0001',
                                                        limit_name='limit-0001',
                                                        counter_name='counter-0001',
                                                        count_up_value=1,
                                                        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,
                                            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,
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            user_id='#{userId}'
                                        ),
                                        inventory.AcquireItemSetByUserId(
                                            namespace_name='namespace-0001',
                                            inventory_name='inventory-0001',
                                            item_name='item-0001',
                                            acquire_count=1,
                                            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

PurchaseCount

Number of product purchases

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNumber of product purchases name
countint
1 ~ 2147483646Purchase count

RandomDisplayItem

Random displayable items on the Random Showcase

TypeConditionRequiredDefaultValue LimitsDescription
showcaseNamestring
~ 128 charsRandom Displayed Item Name
namestring
UUID~ 128 charsRandom Displayed Item ID
Maintains a unique name for randomly displayed products.
If omitted, the system automatically assigns a name in UUID (Universally Unique Identifier) format.
metadatastring~ 2048 charsMetadata
verifyActionsList<VerifyAction>[]0 ~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>[]0 ~ 10 itemsList of Consume Action
acquireActionsList<AcquireAction>
[]1 ~ 100 itemsList of Acquire Action
currentPurchaseCountint
1 ~ 2147483646Current purchase count
maximumPurchaseCountint
1 ~ 2147483646Maximum purchase count

ConsumeAction

Consume Action

TypeConditionRequiredDefaultValue LimitsDescription
actionString Enum
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",
}
~ 128 charsTypes of actions to be performed in the consume action
requeststring
~ 524288 charsJSON string of the request used when executing the action

VerifyAction

Verify Action

TypeConditionRequiredDefaultValue LimitsDescription
actionString Enum
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",
}
~ 128 charsTypes of actions to be performed in the verify task
requeststring
~ 524288 charsJSON string of the request used when executing the action

AcquireAction

Acquire Action

TypeConditionRequiredDefaultValue LimitsDescription
actionString Enum
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",
}
~ 128 charsTypes of actions to be performed in the acquire action
requeststring
~ 524288 charsJSON string of the request used when executing the action

Config

Configuration

Set values to be applied to transaction variables

TypeConditionRequiredDefaultValue LimitsDescription
keystring
~ 64 charsName
valuestring~ 51200 charsValue

VerifyActionResult

Verify action execution result

TypeConditionRequiredDefaultValue LimitsDescription
actionString Enum
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",
}
~ 128 charsTypes of actions to be performed in the verify task
verifyRequeststring
~ 524288 charsJSON string of the request used when executing the action
statusCodeint0 ~ 999Status code
verifyResultstring~ 1048576 charsResult payload

ConsumeActionResult

Consume action execution result

TypeConditionRequiredDefaultValue LimitsDescription
actionString Enum
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",
}
~ 128 charsTypes of actions to be performed in the consume action
consumeRequeststring
~ 524288 charsJSON string of the request used when executing the action
statusCodeint0 ~ 999Status code
consumeResultstring~ 1048576 charsResult payload

AcquireActionResult

Acquire action execution result

TypeConditionRequiredDefaultValue LimitsDescription
actionString Enum
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",
}
~ 128 charsTypes of actions to be performed in the acquire action
acquireRequeststring
~ 524288 charsJSON string of the request used when executing the action
statusCodeint0 ~ 999Status code
acquireResultstring~ 1048576 charsResult payload

TransactionResult

Transaction execution results

Transaction execution results executed using server-side transaction auto-execution functionality

TypeConditionRequiredDefaultValue LimitsDescription
transactionIdstring
36 ~ 36 charsTransaction ID
verifyResultsList<VerifyActionResult>0 ~ 10 itemsList of verify action execution results
consumeResultsList<ConsumeActionResult>[]0 ~ 10 itemsList of consume action execution results
acquireResultsList<AcquireActionResult>[]0 ~ 100 itemsList of acquire action execution results
hasErrorbool
falseWhether an error occurred during transaction execution

LogSetting

Log Export Settings

Manages log data export settings. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, and debugging.

TypeConditionRequiredDefaultValue LimitsDescription
loggingNamespaceIdstring
~ 1024 charsGS2-Log namespace GRN to output logs

TransactionSetting

Transaction settings

Transaction settings control how transactions are executed, their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, Distributor, batch application of script results, and asynchronous acquisition actions via JobQueue enables robust transaction management tailored to game logic.

TypeConditionRequiredDefaultValue LimitsDescription
enableAutoRunbool
falseWhether to automatically execute issued transactions on the server side
enableAtomicCommitbool{enableAutoRun} == true
✓*
falseWhether to commit the execution of transactions atomically
* Required if enableAutoRun is true
transactionUseDistributorbool{enableAtomicCommit} == true
✓*
falseWhether to execute transactions asynchronously
* Required if enableAtomicCommit is true
commitScriptResultInUseDistributorbool{transactionUseDistributor} == true
✓*
falseWhether to execute the commit processing of the script result asynchronously
* Required if transactionUseDistributor is true
acquireActionUseJobQueuebool{enableAtomicCommit} == true
✓*
falseWhether to use GS2-JobQueue to execute the acquire action
* Required if enableAtomicCommit is true
distributorNamespaceIdstring
“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor namespace used for transaction execution
queueNamespaceIdstring
“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsNamespace in GS2-JobQueue used to run the transaction

ScriptSetting

Script settings

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.

In contrast, asynchronous execution does not block processing until the script has finished executing. Since the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API’s response flow. For this reason, asynchronous execution is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

TypeConditionRequiredDefaultValue LimitsDescription
triggerScriptIdstring~ 1024 charsScript GRN to be executed during processing
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetTypeString Enum
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none”~ 128 charsNotification of Completion
Enumerator String DefinitionDescription
“none”None
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsScript GRN to be executed upon completion
Must be specified in GRN format starting with “grn:gs2:”.

* Enabled if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-JobQueue namespace GRN to execute asynchronous execution scripts
Used when you want to know the completion of the done script.

* Enabled if doneTriggerTargetType is “gs2_script”

GitHubCheckoutSetting

Setup to check out master data from GitHub

TypeConditionRequiredDefaultValue LimitsDescription
apiKeyIdstring
~ 1024 charsGitHub API key GRN
repositoryNamestring
~ 1024 charsRepository Name
sourcePathstring
~ 1024 charsMaster data (JSON) file path
referenceTypeString Enum
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
~ 128 charsSource of code
Enumerator String DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHashstring{referenceType} == “commit_hash”
✓*
~ 1024 charsCommit hash
* Required if referenceType is “commit_hash”
branchNamestring{referenceType} == “branch”
✓*
~ 1024 charsBranch Name
* Required if referenceType is “branch”
tagNamestring{referenceType} == “tag”
✓*
~ 1024 charsTag Name
* Required if referenceType is “tag”

RandomDisplayItemModel

Random displayable items on the Random Showcase

You can set the probability of selecting items for the display shelf.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
UUID~ 128 charsRandom Displayed Item ID
Maintains a unique name for randomly displayed products.
If omitted, the system automatically assigns a name in UUID (Universally Unique Identifier) format.
metadatastring~ 2048 charsMetadata
verifyActionsList<VerifyAction>[]0 ~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>[]0 ~ 10 itemsList of Consumption Action
acquireActionsList<AcquireAction>
[]1 ~ 100 itemsList of Acquire Action
stockint
1 ~ 2147483646Stock
weightint
1 ~ 2147483646Emission Weight

DisplayItemMaster

Displayed Item Master Data

TypeConditionRequiredDefaultValue LimitsDescription
displayItemIdstring
UUID~ 128 charsDisplayed Item ID
Maintains a unique name for displayed products.
If omitted, the system automatically assigns a name in UUID (Universally Unique Identifier) format.
typeString Enum
enum {
  “salesItem”,
  “salesItemGroup”
}
~ 128 charsType
Enumerator String DefinitionDescription
“salesItem”Product
“salesItemGroup”Product Group
salesItemNamestring{type} == “salesItem”
✓*
~ 128 charsName of the product to be displayed
* Required if type is “salesItem”
salesItemGroupNamestring{type} == “salesItemGroup”
✓*
~ 128 charsName of the product group to be displayed
* Required if type is “salesItemGroup”
salesPeriodEventIdstring~ 1024 charsProduct group to be displayed
revisionlong00 ~ 9223372036854775805Revision