GS2-Deploy/CDK Reference of GS2-Enchant

Entities

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
transactionSettingTransactionSettingTransaction settings
logSettingLogSettingLog output settings

GetAttr

TypeDescription
ItemNamespaceNamespace created

Implementation Example

Type: GS2::Enchant::Namespace
Properties:
  Name: namespace1
  Description: null
  TransactionSetting: 
    EnableAutoRun: false
    QueueNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001
    KeyId: grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001
  LogSetting: 
    LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1
from gs2_cdk import Stack, core, enchant

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        enchant.Namespace(
            stack=self,
            name="namespace-0001",
            transaction_setting=core.TransactionSetting(
                enable_auto_run=False,
                options=core.TransactionSettingOptions(
                    distributor_namespace_id=,
                    key_id='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001',
                    queue_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001',
                )
            ),
            options=enchant.NamespaceOptions(
                log_setting=core.LogSetting(
                    logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
                ),
            ),
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Enchant\Model\Namespace_(
            stack: $this,
            name: "namespace-0001",
            transactionSetting: new \Gs2Cdk\Core\Model\TransactionSetting(
                enableAutoRun: False,
                options: new \Gs2Cdk\Core\Model\Options\TransactionSettingOptions(
                    distributorNamespaceId: ,
                    keyId: "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
                    queueNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
                )
            ),
            options: new \Gs2Cdk\Enchant\Model\Options\NamespaceOptions(
                logSetting: new \Gs2Cdk\Core\Model\LogSetting(
                    loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
                ),
            ),
        );
    }
}

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

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import enchant from "@/gs2cdk/enchant";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new enchant.model.Namespace(
            this,
            "namespace-0001",
            new core.TransactionSetting(
                false,
                {
                    ,
                    "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
                    "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
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Enchant.Model.Namespace(
            this,
            "namespace-0001",
            new Gs2Cdk.Core.Model.TransactionSetting(
                false,
                new Gs2Cdk.Core.Model.Options.TransactionSettingOptions(
                    DistributorNamespaceId = ,
                    KeyId = "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
                    QueueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
                }
            ),
            new Gs2Cdk.Gs2Enchant.Model.Options.NamespaceOptions {
                logSetting = new Gs2Cdk.Core.Model.LogSetting(
                    "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                ),
            }
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

CurrentParameterMaster

Currently available enchantd rate masters

GS2 uses JSON format files for master data management. By uploading the file, the settings can actually be reflected on the server.

We provide a Master Data Editor on the Management Console as a way to create JSON files, but you can also create your own JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.

Please refer to the documentation for the format of the JSON file.

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
settingsstring~ 5242880 charsMaster data

GetAttr

TypeDescription
ItemCurrentParameterMasterUpdated and currently available parameter settings

Implementation Example

Type: GS2::Enchant::CurrentParameterMaster
Properties:
  NamespaceName: namespace1
  Settings: {"version": "2023-07-18", "balanceParameterModels": [{"name": "balance-0001", "metadata": "BALANCE_0001", "totalValue": 100, "initialValueStrategy": "average", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}, {"name": "parameter-0003", "metadata": "PARAMETER_0003"}]}, {"name": "balance-0002", "metadata": "BALANCE_0002", "totalValue": 200, "initialValueStrategy": "lottery", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}, {"name": "parameter-0003", "metadata": "PARAMETER_0003"}, {"name": "parameter-0004", "metadata": "PARAMETER_0004"}]}, {"name": "balance-0003", "metadata": "BALANCE_0003", "totalValue": 500, "initialValueStrategy": "average", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}]}], "rarityParameterModels": [{"name": "rarity-0001", "metadata": "RARITY_0001", "maximumParameterCount": 5, "parameterCounts": [{"count": 0, "weight": 1}, {"count": 1, "weight": 2}, {"count": 2, "weight": 3}], "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001", "resourceName": "resource-0001", "resourceValue": 10, "weight": 1}, {"name": "parameter-0002", "metadata": "PARAMETER_0002", "resourceName": "resource-0002", "resourceValue": 20, "weight": 2}, {"name": "parameter-0003", "metadata": "PARAMETER_0003", "resourceName": "resource-0003", "resourceValue": 30, "weight": 3}]}, {"name": "rarity-0002", "metadata": "RARITY_0002", "maximumParameterCount": 10, "parameterCounts": [{"count": 1, "weight": 10}, {"count": 2, "weight": 20}, {"count": 3, "weight": 30}], "parameters": [{"name": "parameter-1001", "metadata": "PARAMETER_1001", "resourceName": "resource-1001", "resourceValue": 100, "weight": 10}, {"name": "parameter-1002", "metadata": "PARAMETER_1002", "resourceName": "resource-1002", "resourceValue": 200, "weight": 20}, {"name": "parameter-1003", "metadata": "PARAMETER_1003", "resourceName": "resource-1003", "resourceValue": 300, "weight": 30}]}, {"name": "rarity-0003", "metadata": "RARITY_0003", "maximumParameterCount": 3, "parameterCounts": [{"count": 2, "weight": 5}, {"count": 3, "weight": 10}, {"count": 4, "weight": 15}], "parameters": [{"name": "parameter-2001", "metadata": "PARAMETER_2001", "resourceName": "resource-2001", "resourceValue": 1000, "weight": 2}, {"name": "parameter-2002", "metadata": "PARAMETER_2002", "resourceName": "resource-2002", "resourceValue": 2000, "weight": 4}, {"name": "parameter-2003", "metadata": "PARAMETER_2003", "resourceName": "resource-2003", "resourceValue": 3000, "weight": 6}, {"name": "parameter-0004", "metadata": "PARAMETER_0004", "resourceName": "resource-2004", "resourceValue": 4000, "weight": 8}]}]}
from gs2_cdk import Stack, core, enchant

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        enchant.Namespace(
            stack=self,
            # omission
        ).master_data(
            [
                enchant.BalanceParameterModel(
                    name='balance-0001',
                    total_value=100,
                    initial_value_strategy='average',
                    parameters=[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                        {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                        {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
                        ],
                    options=enchant.BalanceParameterModelOptions(
                        metadata='BALANCE_0001',
                    ),
                ),
                enchant.BalanceParameterModel(
                    name='balance-0002',
                    total_value=200,
                    initial_value_strategy='lottery',
                    parameters=[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                        {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                        {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
                        {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'},
                        ],
                    options=enchant.BalanceParameterModelOptions(
                        metadata='BALANCE_0002',
                    ),
                ),
                enchant.BalanceParameterModel(
                    name='balance-0003',
                    total_value=500,
                    initial_value_strategy='average',
                    parameters=[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                        {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                        ],
                    options=enchant.BalanceParameterModelOptions(
                        metadata='BALANCE_0003',
                    ),
                ),
            ],
            [
                enchant.RarityParameterModel(
                    name='rarity-0001',
                    maximum_parameter_count=5,
                    parameter_counts=[    {'count': 0, 'weight': 1},
                        {'count': 1, 'weight': 2},
                        {'count': 2, 'weight': 3},
                        ],
                    parameters=[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
                        {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
                        {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3},
                        ],
                    options=enchant.RarityParameterModelOptions(
                        metadata='RARITY_0001',
                    ),
                ),
                enchant.RarityParameterModel(
                    name='rarity-0002',
                    maximum_parameter_count=10,
                    parameter_counts=[    {'count': 1, 'weight': 10},
                        {'count': 2, 'weight': 20},
                        {'count': 3, 'weight': 30},
                        ],
                    parameters=[    {'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
                        {'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
                        {'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30},
                        ],
                    options=enchant.RarityParameterModelOptions(
                        metadata='RARITY_0002',
                    ),
                ),
                enchant.RarityParameterModel(
                    name='rarity-0003',
                    maximum_parameter_count=3,
                    parameter_counts=[    {'count': 2, 'weight': 5},
                        {'count': 3, 'weight': 10},
                        {'count': 4, 'weight': 15},
                        ],
                    parameters=[    {'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
                        {'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
                        {'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
                        {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8},
                        ],
                    options=enchant.RarityParameterModelOptions(
                        metadata='RARITY_0003',
                    ),
                ),
            ],
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        (new \Gs2Cdk\Enchant\Model\Namespace_(
            stack: $this,
            // omission
        ))->masterData(
            [
                new \Gs2Cdk\Enchant\Model\BalanceParameterModel(
                    name:"balance-0001",
                    totalValue:100,
                    initialValueStrategy: \Gs2Cdk\Enchant\Model\Enums\CurrentParameterMasterInitialValueStrategy::AVERAGE
                    parameters:[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
                    ],
                    options: new \Gs2Cdk\Enchant\Model\Options\BalanceParameterModelOptions(
                        metadata:"BALANCE_0001",
                    ),
                ),
                new \Gs2Cdk\Enchant\Model\BalanceParameterModel(
                    name:"balance-0002",
                    totalValue:200,
                    initialValueStrategy: \Gs2Cdk\Enchant\Model\Enums\CurrentParameterMasterInitialValueStrategy::LOTTERY
                    parameters:[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'},
                    ],
                    options: new \Gs2Cdk\Enchant\Model\Options\BalanceParameterModelOptions(
                        metadata:"BALANCE_0002",
                    ),
                ),
                new \Gs2Cdk\Enchant\Model\BalanceParameterModel(
                    name:"balance-0003",
                    totalValue:500,
                    initialValueStrategy: \Gs2Cdk\Enchant\Model\Enums\CurrentParameterMasterInitialValueStrategy::AVERAGE
                    parameters:[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    ],
                    options: new \Gs2Cdk\Enchant\Model\Options\BalanceParameterModelOptions(
                        metadata:"BALANCE_0003",
                    ),
                ),
            ],
            [
                new \Gs2Cdk\Enchant\Model\RarityParameterModel(
                    name:"rarity-0001",
                    maximumParameterCount:5,
                    parameterCounts:[    {'count': 0, 'weight': 1},
                    {'count': 1, 'weight': 2},
                    {'count': 2, 'weight': 3},
                    ],
                    parameters:[    {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3},
                    ],
                    options: new \Gs2Cdk\Enchant\Model\Options\RarityParameterModelOptions(
                        metadata:"RARITY_0001",
                    ),
                ),
                new \Gs2Cdk\Enchant\Model\RarityParameterModel(
                    name:"rarity-0002",
                    maximumParameterCount:10,
                    parameterCounts:[    {'count': 1, 'weight': 10},
                    {'count': 2, 'weight': 20},
                    {'count': 3, 'weight': 30},
                    ],
                    parameters:[    {'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
                    {'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
                    {'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30},
                    ],
                    options: new \Gs2Cdk\Enchant\Model\Options\RarityParameterModelOptions(
                        metadata:"RARITY_0002",
                    ),
                ),
                new \Gs2Cdk\Enchant\Model\RarityParameterModel(
                    name:"rarity-0003",
                    maximumParameterCount:3,
                    parameterCounts:[    {'count': 2, 'weight': 5},
                    {'count': 3, 'weight': 10},
                    {'count': 4, 'weight': 15},
                    ],
                    parameters:[    {'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
                    {'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
                    {'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8},
                    ],
                    options: new \Gs2Cdk\Enchant\Model\Options\RarityParameterModelOptions(
                        metadata:"RARITY_0003",
                    ),
                ),
            ],
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.enchant.model.Namespace(
            this,
            // omission
        ).masterData(
            Arrays.asList(
                new io.gs2.cdk.enchant.model.BalanceParameterModel(
                    "balance-0001",
                    100L,
                    Average,
                    Arrays.asList(
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'}
                    ),
                    new io.gs2.cdk.enchant.model.options.BalanceParameterModelOptions() {
                        {
                            metadata: "BALANCE_0001";
                        }
                    }
                ),
                new io.gs2.cdk.enchant.model.BalanceParameterModel(
                    "balance-0002",
                    200L,
                    Lottery,
                    Arrays.asList(
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'}
                    ),
                    new io.gs2.cdk.enchant.model.options.BalanceParameterModelOptions() {
                        {
                            metadata: "BALANCE_0002";
                        }
                    }
                ),
                new io.gs2.cdk.enchant.model.BalanceParameterModel(
                    "balance-0003",
                    500L,
                    Average,
                    Arrays.asList(
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'}
                    ),
                    new io.gs2.cdk.enchant.model.options.BalanceParameterModelOptions() {
                        {
                            metadata: "BALANCE_0003";
                        }
                    }
                )
            ),
            Arrays.asList(
                new io.gs2.cdk.enchant.model.RarityParameterModel(
                    "rarity-0001",
                    5,
                    Arrays.asList(
                        {'count': 0, 'weight': 1},
                    {'count': 1, 'weight': 2},
                    {'count': 2, 'weight': 3}
                    ),
                    Arrays.asList(
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3}
                    ),
                    new io.gs2.cdk.enchant.model.options.RarityParameterModelOptions() {
                        {
                            metadata: "RARITY_0001";
                        }
                    }
                ),
                new io.gs2.cdk.enchant.model.RarityParameterModel(
                    "rarity-0002",
                    10,
                    Arrays.asList(
                        {'count': 1, 'weight': 10},
                    {'count': 2, 'weight': 20},
                    {'count': 3, 'weight': 30}
                    ),
                    Arrays.asList(
                        {'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
                    {'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
                    {'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30}
                    ),
                    new io.gs2.cdk.enchant.model.options.RarityParameterModelOptions() {
                        {
                            metadata: "RARITY_0002";
                        }
                    }
                ),
                new io.gs2.cdk.enchant.model.RarityParameterModel(
                    "rarity-0003",
                    3,
                    Arrays.asList(
                        {'count': 2, 'weight': 5},
                    {'count': 3, 'weight': 10},
                    {'count': 4, 'weight': 15}
                    ),
                    Arrays.asList(
                        {'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
                    {'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
                    {'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8}
                    ),
                    new io.gs2.cdk.enchant.model.options.RarityParameterModelOptions() {
                        {
                            metadata: "RARITY_0003";
                        }
                    }
                )
            )
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import enchant from "@/gs2cdk/enchant";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new enchant.model.Namespace(
            this,
            // omission
        ).masterData(
            [
                new enchant.model.BalanceParameterModel(
                    "balance-0001",
                    100,
                    enchant.model.CurrentParameterMasterInitialValueStrategy.AVERAGE,
                    [
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'}
                    ],
                    {
                        metadata: "BALANCE_0001"
                    }
                ),
                new enchant.model.BalanceParameterModel(
                    "balance-0002",
                    200,
                    enchant.model.CurrentParameterMasterInitialValueStrategy.LOTTERY,
                    [
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'}
                    ],
                    {
                        metadata: "BALANCE_0002"
                    }
                ),
                new enchant.model.BalanceParameterModel(
                    "balance-0003",
                    500,
                    enchant.model.CurrentParameterMasterInitialValueStrategy.AVERAGE,
                    [
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'}
                    ],
                    {
                        metadata: "BALANCE_0003"
                    }
                )
            ],
            [
                new enchant.model.RarityParameterModel(
                    "rarity-0001",
                    5,
                    [
                        {'count': 0, 'weight': 1},
                    {'count': 1, 'weight': 2},
                    {'count': 2, 'weight': 3}
                    ],
                    [
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3}
                    ],
                    {
                        metadata: "RARITY_0001"
                    }
                ),
                new enchant.model.RarityParameterModel(
                    "rarity-0002",
                    10,
                    [
                        {'count': 1, 'weight': 10},
                    {'count': 2, 'weight': 20},
                    {'count': 3, 'weight': 30}
                    ],
                    [
                        {'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
                    {'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
                    {'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30}
                    ],
                    {
                        metadata: "RARITY_0002"
                    }
                ),
                new enchant.model.RarityParameterModel(
                    "rarity-0003",
                    3,
                    [
                        {'count': 2, 'weight': 5},
                    {'count': 3, 'weight': 10},
                    {'count': 4, 'weight': 15}
                    ],
                    [
                        {'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
                    {'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
                    {'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8}
                    ],
                    {
                        metadata: "RARITY_0003"
                    }
                )
            ]
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Enchant.Model.Namespace(
            this,
            // omission
        ).MasterData(
            new [] {
                new Gs2Cdk.Gs2Enchant.Model.BalanceParameterModel(
                    "balance-0001",
                    100L,
                    Gs2Cdk.Gs2Enchant.Model.Enums.CurrentParameterMasterInitialValueStrategy.Average,
                    new Gs2Cdk.Gs2Enchant.Model.BalanceParameterValueModel[] {
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.Options.BalanceParameterModelOptions {
                        metadata = "BALANCE_0001",
                    }
                ),
                new Gs2Cdk.Gs2Enchant.Model.BalanceParameterModel(
                    "balance-0002",
                    200L,
                    Gs2Cdk.Gs2Enchant.Model.Enums.CurrentParameterMasterInitialValueStrategy.Lottery,
                    new Gs2Cdk.Gs2Enchant.Model.BalanceParameterValueModel[] {
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.Options.BalanceParameterModelOptions {
                        metadata = "BALANCE_0002",
                    }
                ),
                new Gs2Cdk.Gs2Enchant.Model.BalanceParameterModel(
                    "balance-0003",
                    500L,
                    Gs2Cdk.Gs2Enchant.Model.Enums.CurrentParameterMasterInitialValueStrategy.Average,
                    new Gs2Cdk.Gs2Enchant.Model.BalanceParameterValueModel[] {
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.Options.BalanceParameterModelOptions {
                        metadata = "BALANCE_0003",
                    }
                )
            },
            new [] {
                new Gs2Cdk.Gs2Enchant.Model.RarityParameterModel(
                    "rarity-0001",
                    5,
                    new Gs2Cdk.Gs2Enchant.Model.RarityParameterCountModel[] {
                        {'count': 0, 'weight': 1},
                    {'count': 1, 'weight': 2},
                    {'count': 2, 'weight': 3}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.RarityParameterValueModel[] {
                        {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
                    {'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
                    {'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.Options.RarityParameterModelOptions {
                        metadata = "RARITY_0001",
                    }
                ),
                new Gs2Cdk.Gs2Enchant.Model.RarityParameterModel(
                    "rarity-0002",
                    10,
                    new Gs2Cdk.Gs2Enchant.Model.RarityParameterCountModel[] {
                        {'count': 1, 'weight': 10},
                    {'count': 2, 'weight': 20},
                    {'count': 3, 'weight': 30}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.RarityParameterValueModel[] {
                        {'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
                    {'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
                    {'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.Options.RarityParameterModelOptions {
                        metadata = "RARITY_0002",
                    }
                ),
                new Gs2Cdk.Gs2Enchant.Model.RarityParameterModel(
                    "rarity-0003",
                    3,
                    new Gs2Cdk.Gs2Enchant.Model.RarityParameterCountModel[] {
                        {'count': 2, 'weight': 5},
                    {'count': 3, 'weight': 10},
                    {'count': 4, 'weight': 15}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.RarityParameterValueModel[] {
                        {'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
                    {'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
                    {'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
                    {'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8}
                    },
                    new Gs2Cdk.Gs2Enchant.Model.Options.RarityParameterModelOptions {
                        metadata = "RARITY_0003",
                    }
                )
            }
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

BalanceParameterValueModel

TypeRequireDefaultLimitationDescription
namestring~ 64 charsName
metadatastring~ 512 charsmetadata

RarityParameterCountModel

TypeRequireDefaultLimitationDescription
countint~ 10Value
weightint1 ~ 2147483646Weight

RarityParameterValueModel

TypeRequireDefaultLimitationDescription
namestring~ 64 charsName
metadatastring~ 512 charsmetadata
resourceNamestring~ 64 charsParameter Resource Name for Game(Not used for GS2)
resourceValuelong~ 9223372036854775805Parameter Resource Value for Game(Not used for GS2)
weightint1 ~ 2147483646Weight

BalanceParameterValue

TypeRequireDefaultLimitationDescription
namestring~ 64 charsName
valuelong~ 9223372036854775805Value

RarityParameterValue

TypeRequireDefaultLimitationDescription
namestring~ 64 charsName
resourceNamestring~ 64 charsResource Name
resourceValuelong~ 9223372036854775805Resource Value

Config

TypeRequireDefaultLimitationDescription
keystring~ 64 charsName
valuestring~ 51200 charsValue

GitHubCheckoutSetting

TypeRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum [‘commit_hash’, ‘branch’, ’tag’]~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

ScriptSetting

TypeRequireDefaultLimitationDescription
triggerScriptIdstring~ 1024 charsScript GRN
doneTriggerTargetTypeenum [’none’, ‘gs2_script’, ‘aws’]“none”~ 128 charsNotification of Completion
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsScript GRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsNamespace GRN

LogSetting

TypeRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

TransactionSetting

TypeRequireDefaultLimitationDescription
enableAutoRunboolfalseAutomatically run issued stamp sheets on the server side, or
distributorNamespaceIdstring{enableAutoRun}~ 1024 charsGS2-Distributor namespace used for stamp sheet execution
keyIdstring!{enableAutoRun}~ 1024 charsGS2-Key encryption key used to sign the stamp sheet
queueNamespaceIdstring~ 1024 charsNamespace in GS2-JobQueue used to run the stamp sheet