GS2-Deploy/CDK Reference of GS2-Stamina

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
overflowTriggerScriptScriptSettingGS2-Script to handle overflow stamina during recovery process
logSettingLogSettingLog output settings

GetAttr

TypeDescription
ItemNamespaceNamespace created

Implementation Example

Type: GS2::Stamina::Namespace
Properties:
  Name: namespace1
  Description: null
  OverflowTriggerScript: 
    TriggerScriptId: $script1.scriptId
    DoneTriggerScriptId: grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1
  LogSetting: 
    LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1
from gs2_cdk import Stack, core, stamina

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        stamina.Namespace(
            stack=self,
            name="namespace-0001",
            options=stamina.NamespaceOptions(
                overflow_trigger_script=core.ScriptSetting(
                    done_trigger_target_type=,
                    options=core.ScriptSettingOptions(
                        trigger_script_id=self.script1.script_id,
                        done_trigger_script_id='grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace-0001',
                        done_trigger_queue_namespace_id=,
                    )
                ),
                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\Stamina\Model\Namespace_(
            stack: $this,
            name: "namespace-0001",
            options: new \Gs2Cdk\Stamina\Model\Options\NamespaceOptions(
                overflowTriggerScript: new \Gs2Cdk\Core\Model\ScriptSetting(
                    doneTriggerTargetType: ,
                    options: new \Gs2Cdk\Core\Model\Options\ScriptSettingOptions(
                        triggerScriptId: self::$script1.scriptId,
                        doneTriggerScriptId: "grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace-0001",
                        doneTriggerQueueNamespaceId: ,
                    )
                ),
                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.stamina.model.Namespace(
            this,
            "namespace-0001",
            new io.gs2.cdk.stamina.model.options.NamespaceOptions() {
                {
                    overflowTriggerScript = new io.gs2.cdk.core.model.ScriptSetting(
                        ,
                        new io.gs2.cdk.core.model.options.ScriptSettingOptions(
                            "$script1.scriptId",
                            "grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace-0001",
                            
                        )
                    );
                    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 stamina from "@/gs2cdk/stamina";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new stamina.model.Namespace(
            this,
            "namespace-0001",
            {
                overflowTriggerScript: new core.ScriptSetting(
                    ,
                    {
                        "$script1.scriptId",
                        "grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace-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.Gs2Stamina.Model.Namespace(
            this,
            "namespace-0001",
            new Gs2Cdk.Gs2Stamina.Model.Options.NamespaceOptions {
                overflowTriggerScript = new Gs2Cdk.Core.Model.ScriptSetting(
                    ,
                    new Gs2Cdk.Core.Model.Options.ScriptSettingOptions(
                        TriggerScriptId = "$script1.scriptId",
                        DoneTriggerScriptId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace-0001",
                        DoneTriggerQueueNamespaceId = 
                    }
                ),
                logSetting = new Gs2Cdk.Core.Model.LogSetting(
                    "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                ),
            }
        );
    }
}

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

CurrentStaminaMaster

Currently available master data

GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings 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 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
ItemCurrentStaminaMasterUpdated and currently available Stamina Master

Implementation Example

Type: GS2::Stamina::CurrentStaminaMaster
Properties:
  NamespaceName: namespace1
  Settings: {
    "version": "2019-02-14",
    "staminaModels": [
      {
        "name": "quest",
        "metadata": "QUEST",
        "recoverIntervalMinutes": 15,
        "recoverValue": 1,
        "initialCapacity": 50,
        "isOverflow": true,
        "maxCapacity": 999,
        "maxStaminaTable": {
          "name": "playerLevel",
          "metadata": "PLAYER_LEVEL",
          "experienceModelId": "playerLevel",
          "values": [
            51,
            52,
            53,
            54,
            55,
            56,
            57,
            58,
            59,
            60,
            61,
            62,
            63,
            64,
            65,
            66,
            67,
            68,
            69,
            70,
            71,
            72,
            73,
            74,
            75,
            76,
            77,
            78,
            79,
            80,
            81,
            82,
            83,
            84,
            85,
            86,
            87,
            88,
            89,
            90,
            91,
            92,
            93,
            94,
            95,
            96,
            97,
            98,
            99,
            100,
            101,
            102,
            103,
            104,
            105,
            106,
            107,
            108,
            109,
            110,
            111,
            112,
            113,
            114,
            115,
            116,
            117,
            118,
            119,
            120,
            121,
            122,
            123,
            124,
            125,
            126,
            127,
            128,
            129
          ]
        },
        "recoverIntervalTable": {
          "name": "staminaRecoverInterval",
          "metadata": "STAMINA_RECOVER_INTERVAL",
          "experienceModelId": "playerLevel",
          "values": [
            41,
            42,
            43,
            44,
            45,
            46,
            47,
            48,
            49,
            50,
            51,
            52,
            53,
            54,
            55,
            56,
            57,
            58,
            59,
            60,
            61,
            62,
            63,
            64,
            65,
            66,
            67,
            68,
            69,
            70,
            71,
            72,
            73,
            74,
            75,
            76,
            77,
            78,
            79,
            80,
            81,
            82,
            83,
            84,
            85,
            86,
            87,
            88,
            89,
            90,
            91,
            92,
            93,
            94,
            95,
            96,
            97,
            98,
            99,
            100,
            101,
            102,
            103,
            104,
            105,
            106,
            107,
            108,
            109,
            110,
            111,
            112,
            113,
            114,
            115,
            116,
            117,
            118,
            119
          ]
        },
        "recoverValueTable": {
          "name": "staminaRecoverValue",
          "metadata": "STAMINA_RECOVER_VALUE",
          "experienceModelId": "playerLevel",
          "values": [
            31,
            32,
            33,
            34,
            35,
            36,
            37,
            38,
            39,
            40,
            41,
            42,
            43,
            44,
            45,
            46,
            47,
            48,
            49,
            50,
            51,
            52,
            53,
            54,
            55,
            56,
            57,
            58,
            59,
            60,
            61,
            62,
            63,
            64,
            65,
            66,
            67,
            68,
            69,
            70,
            71,
            72,
            73,
            74,
            75,
            76,
            77,
            78,
            79,
            80,
            81,
            82,
            83,
            84,
            85,
            86,
            87,
            88,
            89,
            90,
            91,
            92,
            93,
            94,
            95,
            96,
            97,
            98,
            99,
            100,
            101,
            102,
            103,
            104,
            105,
            106,
            107,
            108,
            109
          ]
        }
      },
      {
        "name": "raidBattle",
        "metadata": "RAID_BATTLE",
        "recoverIntervalMinutes": 60,
        "recoverValue": 1,
        "initialCapacity": 10,
        "isOverflow": false
      },
      {
        "name": "special",
        "metadata": "SPECIAL",
        "recoverIntervalMinutes": 30,
        "recoverValue": 3,
        "initialCapacity": 100,
        "isOverflow": true,
        "maxCapacity": 999,
        "maxStaminaTable": {
          "name": "special",
          "metadata": "SPECIAL",
          "experienceModelId": "special",
          "values": [
            102,
            104,
            106,
            108,
            110,
            112,
            114,
            116,
            118,
            120,
            122,
            124,
            126,
            128,
            130,
            132,
            134,
            136,
            138,
            140,
            142,
            144,
            146,
            148,
            150,
            152,
            154,
            156,
            158,
            160,
            162,
            164,
            166,
            168,
            170,
            172,
            174,
            176,
            178,
            180,
            182,
            184,
            186,
            188,
            190,
            192,
            194,
            196,
            198,
            200,
            202,
            204,
            206,
            208,
            210,
            212,
            214,
            216,
            218,
            220,
            222,
            224,
            226,
            228,
            230,
            232,
            234,
            236,
            238,
            240,
            242,
            244,
            246,
            248,
            250,
            252,
            254,
            256,
            258
          ]
        }
      }
    ]
  }
from gs2_cdk import Stack, core, stamina

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        stamina.Namespace(
            stack=self,
            # omission
        ).master_data(
            [
                stamina.StaminaModel(
                    name='quest',
                    recover_interval_minutes=15,
                    recover_value=1,
                    initial_capacity=50,
                    is_overflow=True,
                    options=stamina.StaminaModelOptions(
                        metadata='QUEST',
                        max_capacity=999,
                        max_stamina_table={'name': 'playerLevel', 'metadata': 'PLAYER_LEVEL', 'experienceModelId': 'playerLevel', 'values': [51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129]},
                        recover_interval_table={'name': 'staminaRecoverInterval', 'metadata': 'STAMINA_RECOVER_INTERVAL', 'experienceModelId': 'playerLevel', 'values': [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]},
                        recover_value_table={'name': 'staminaRecoverValue', 'metadata': 'STAMINA_RECOVER_VALUE', 'experienceModelId': 'playerLevel', 'values': [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109]},
                    ),
                ),
                stamina.StaminaModel(
                    name='raidBattle',
                    recover_interval_minutes=60,
                    recover_value=1,
                    initial_capacity=10,
                    options=stamina.StaminaModelOptions(
                        metadata='RAID_BATTLE',
                    ),
                ),
                stamina.StaminaModel(
                    name='special',
                    recover_interval_minutes=30,
                    recover_value=3,
                    initial_capacity=100,
                    is_overflow=True,
                    options=stamina.StaminaModelOptions(
                        metadata='SPECIAL',
                        max_capacity=999,
                        max_stamina_table={'name': 'special', 'metadata': 'SPECIAL', 'experienceModelId': 'special', 'values': [102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258]},
                    ),
                ),
            ],
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        (new \Gs2Cdk\Stamina\Model\Namespace_(
            stack: $this,
            // omission
        ))->masterData(
            [
                new \Gs2Cdk\Stamina\Model\StaminaModel(
                    name:"quest",
                    recoverIntervalMinutes:15,
                    recoverValue:1,
                    initialCapacity:50,
                    isOverflow:True,
                    options: new \Gs2Cdk\Stamina\Model\Options\StaminaModelOptions(
                        metadata:"QUEST",
                        maxCapacity:999,
                        maxStaminaTable:{'name': 'playerLevel', 'metadata': 'PLAYER_LEVEL', 'experienceModelId': 'playerLevel', 'values': [51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129]},
                        recoverIntervalTable:{'name': 'staminaRecoverInterval', 'metadata': 'STAMINA_RECOVER_INTERVAL', 'experienceModelId': 'playerLevel', 'values': [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]},
                        recoverValueTable:{'name': 'staminaRecoverValue', 'metadata': 'STAMINA_RECOVER_VALUE', 'experienceModelId': 'playerLevel', 'values': [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109]},
                    ),
                ),
                new \Gs2Cdk\Stamina\Model\StaminaModel(
                    name:"raidBattle",
                    recoverIntervalMinutes:60,
                    recoverValue:1,
                    initialCapacity:10,
                    options: new \Gs2Cdk\Stamina\Model\Options\StaminaModelOptions(
                        metadata:"RAID_BATTLE",
                    ),
                ),
                new \Gs2Cdk\Stamina\Model\StaminaModel(
                    name:"special",
                    recoverIntervalMinutes:30,
                    recoverValue:3,
                    initialCapacity:100,
                    isOverflow:True,
                    options: new \Gs2Cdk\Stamina\Model\Options\StaminaModelOptions(
                        metadata:"SPECIAL",
                        maxCapacity:999,
                        maxStaminaTable:{'name': 'special', 'metadata': 'SPECIAL', 'experienceModelId': 'special', 'values': [102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258]},
                    ),
                ),
            ],
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.stamina.model.Namespace(
            this,
            // omission
        ).masterData(
            Arrays.asList(
                new io.gs2.cdk.stamina.model.StaminaModel(
                    "quest",
                    15,
                    1,
                    50,
                    true,
                    new io.gs2.cdk.stamina.model.options.StaminaModelOptions() {
                        {
                            metadata: "QUEST";
                            maxCapacity: 999;
                            maxStaminaTable: {'name': 'playerLevel', 'metadata': 'PLAYER_LEVEL', 'experienceModelId': 'playerLevel', 'values': [51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129]};
                            recoverIntervalTable: {'name': 'staminaRecoverInterval', 'metadata': 'STAMINA_RECOVER_INTERVAL', 'experienceModelId': 'playerLevel', 'values': [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]};
                            recoverValueTable: {'name': 'staminaRecoverValue', 'metadata': 'STAMINA_RECOVER_VALUE', 'experienceModelId': 'playerLevel', 'values': [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109]};
                        }
                    }
                ),
                new io.gs2.cdk.stamina.model.StaminaModel(
                    "raidBattle",
                    60,
                    1,
                    10,
                    new io.gs2.cdk.stamina.model.options.StaminaModelOptions() {
                        {
                            metadata: "RAID_BATTLE";
                        }
                    }
                ),
                new io.gs2.cdk.stamina.model.StaminaModel(
                    "special",
                    30,
                    3,
                    100,
                    true,
                    new io.gs2.cdk.stamina.model.options.StaminaModelOptions() {
                        {
                            metadata: "SPECIAL";
                            maxCapacity: 999;
                            maxStaminaTable: {'name': 'special', 'metadata': 'SPECIAL', 'experienceModelId': 'special', 'values': [102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258]};
                        }
                    }
                )
            )
        );
    }
}

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

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new stamina.model.Namespace(
            this,
            // omission
        ).masterData(
            [
                new stamina.model.StaminaModel(
                    "quest",
                    15,
                    1,
                    50,
                    true,
                    {
                        metadata: "QUEST",
                        maxCapacity: 999,
                        maxStaminaTable: {'name': 'playerLevel', 'metadata': 'PLAYER_LEVEL', 'experienceModelId': 'playerLevel', 'values': [51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129]},
                        recoverIntervalTable: {'name': 'staminaRecoverInterval', 'metadata': 'STAMINA_RECOVER_INTERVAL', 'experienceModelId': 'playerLevel', 'values': [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]},
                        recoverValueTable: {'name': 'staminaRecoverValue', 'metadata': 'STAMINA_RECOVER_VALUE', 'experienceModelId': 'playerLevel', 'values': [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109]}
                    }
                ),
                new stamina.model.StaminaModel(
                    "raidBattle",
                    60,
                    1,
                    10,
                    {
                        metadata: "RAID_BATTLE"
                    }
                ),
                new stamina.model.StaminaModel(
                    "special",
                    30,
                    3,
                    100,
                    true,
                    {
                        metadata: "SPECIAL",
                        maxCapacity: 999,
                        maxStaminaTable: {'name': 'special', 'metadata': 'SPECIAL', 'experienceModelId': 'special', 'values': [102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258]}
                    }
                )
            ]
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Stamina.Model.Namespace(
            this,
            // omission
        ).MasterData(
            new [] {
                new Gs2Cdk.Gs2Stamina.Model.StaminaModel(
                    "quest",
                    15,
                    1,
                    50,
                    true,
                    new Gs2Cdk.Gs2Stamina.Model.Options.StaminaModelOptions {
                        metadata = "QUEST",
                        maxCapacity = 999,
                        maxStaminaTable = {'name': 'playerLevel', 'metadata': 'PLAYER_LEVEL', 'experienceModelId': 'playerLevel', 'values': [51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129]},
                        recoverIntervalTable = {'name': 'staminaRecoverInterval', 'metadata': 'STAMINA_RECOVER_INTERVAL', 'experienceModelId': 'playerLevel', 'values': [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]},
                        recoverValueTable = {'name': 'staminaRecoverValue', 'metadata': 'STAMINA_RECOVER_VALUE', 'experienceModelId': 'playerLevel', 'values': [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109]},
                    }
                ),
                new Gs2Cdk.Gs2Stamina.Model.StaminaModel(
                    "raidBattle",
                    60,
                    1,
                    10,
                    new Gs2Cdk.Gs2Stamina.Model.Options.StaminaModelOptions {
                        metadata = "RAID_BATTLE",
                    }
                ),
                new Gs2Cdk.Gs2Stamina.Model.StaminaModel(
                    "special",
                    30,
                    3,
                    100,
                    true,
                    new Gs2Cdk.Gs2Stamina.Model.Options.StaminaModelOptions {
                        metadata = "SPECIAL",
                        maxCapacity = 999,
                        maxStaminaTable = {'name': 'special', 'metadata': 'SPECIAL', 'experienceModelId': 'special', 'values': [102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258]},
                    }
                )
            }
        );
    }
}

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

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

LogSetting

TypeRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

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