GS2-Deploy/CDK Reference of GS2-Stamina

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

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~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
overflowTriggerScriptstring~ 1024 charsGS2-Script to handle overflow stamina during recovery process
logSettingLogSettingLog output settings

GetAttr

TypeDescription
ItemNamespaceNamespace created

Implementation Example

Type: GS2::Stamina::Namespace
Properties:
  Name: namespace-0001
  Description: null
  OverflowTriggerScript: grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script
  LogSetting: 
    LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001
import "github.com/gs2io/gs2-golang-cdk/core"
import "github.com/gs2io/gs2-golang-cdk/stamina"
import "github.com/openlyinc/pointy"

SampleStack := core.NewStack()
stamina.NewNamespace(
    &SampleStack,
    "namespace-0001",
    stamina.NamespaceOptions{
        OverflowTriggerScript: "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
        LogSetting: stamina.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\Stamina\Model\Namespace_(
            stack: $this,
            name: "namespace-0001",
            options: new \Gs2Cdk\Stamina\Model\Options\NamespaceOptions(
                overflowTriggerScript: "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
                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()
                        .withoverflowTriggerScript = "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script"
                        .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.Gs2Stamina.Model.Namespace(
            stack: this,
            name: "namespace-0001",
            options: new Gs2Cdk.Gs2Stamina.Model.Options.NamespaceOptions
            {
                overflowTriggerScript = "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
                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 stamina from "@/gs2cdk/stamina";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new stamina.model.Namespace(
            this,
            "namespace-0001",
            {
                overflowTriggerScript: "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
                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, stamina

class SampleStack(Stack):

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

print(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.

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
settingsstring~ 5242880 charsMaster data

GetAttr

TypeDescription
ItemCurrentStaminaMasterUpdated and currently available Stamina Master

Implementation Example

Type: GS2::Stamina::CurrentStaminaMaster
Properties:
  NamespaceName: namespace-0001
  Settings: {
    "version": "2019-02-14",
    "staminaModels": [
      {
        "name": "quest",
        "recoverIntervalMinutes": 15,
        "recoverValue": 1,
        "initialCapacity": 50,
        "isOverflow": 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
            ]
          }
      },
      {
        "name": "raidBattle",
        "recoverIntervalMinutes": 60,
        "recoverValue": 1,
        "initialCapacity": 10,
        "metadata": "RAID_BATTLE"
      },
      {
        "name": "special",
        "recoverIntervalMinutes": 30,
        "recoverValue": 3,
        "initialCapacity": 100,
        "isOverflow": 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
            ]
          }
      }
    ]
  }
import "github.com/gs2io/gs2-golang-cdk/core"
import "github.com/gs2io/gs2-golang-cdk/stamina"
import "github.com/openlyinc/pointy"

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

println(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:new \Gs2Cdk\Stamina\Model\MaxStaminaTable(
                            name = "playerLevel",
                            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],
                            option: new \Gs2Cdk\stamina\Model\Options\MaxStaminaTableOptions(
                                metadata = "PLAYER_LEVEL",
                            )
                        ),
                        recoverIntervalTable:new \Gs2Cdk\Stamina\Model\RecoverIntervalTable(
                            name = "staminaRecoverInterval",
                            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],
                            option: new \Gs2Cdk\stamina\Model\Options\RecoverIntervalTableOptions(
                                metadata = "STAMINA_RECOVER_INTERVAL",
                            )
                        ),
                        recoverValueTable:new \Gs2Cdk\Stamina\Model\RecoverValueTable(
                            name = "staminaRecoverValue",
                            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],
                            option: new \Gs2Cdk\stamina\Model\Options\RecoverValueTableOptions(
                                metadata = "STAMINA_RECOVER_VALUE",
                            )
                        )
                    )
                ),
                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:new \Gs2Cdk\Stamina\Model\MaxStaminaTable(
                            name = "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],
                            option: new \Gs2Cdk\stamina\Model\Options\MaxStaminaTableOptions(
                                metadata = "SPECIAL",
                            )
                        )
                    )
                )
            ]
        );
    }
}

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()
                            .withMetadata("QUEST")
                            .withMaxCapacity(999)
                            .withMaxStaminaTable(new io.gs2.cdk.stamina.model.MaxStaminaTable(
                            name = "playerLevel",
                            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],
                            option: new io.gs2.cdk.stamina.model.options.MaxStaminaTableOptions()
                                .withMetadata("PLAYER_LEVEL"),
                            )
                        ))
                            .withRecoverIntervalTable(new io.gs2.cdk.stamina.model.RecoverIntervalTable(
                            name = "staminaRecoverInterval",
                            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],
                            option: new io.gs2.cdk.stamina.model.options.RecoverIntervalTableOptions()
                                .withMetadata("STAMINA_RECOVER_INTERVAL"),
                            )
                        ))
                            .withRecoverValueTable(new io.gs2.cdk.stamina.model.RecoverValueTable(
                            name = "staminaRecoverValue",
                            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],
                            option: new io.gs2.cdk.stamina.model.options.RecoverValueTableOptions()
                                .withMetadata("STAMINA_RECOVER_VALUE"),
                            )
                        ))
                    }
                ),
                new io.gs2.cdk.stamina.model.StaminaModel(
                    "raidBattle",
                    60,
                    1,
                    10,
                    new io.gs2.cdk.stamina.model.options.StaminaModelOptions()
                            .withMetadata("RAID_BATTLE")
                    }
                ),
                new io.gs2.cdk.stamina.model.StaminaModel(
                    "special",
                    30,
                    3,
                    100,
                    true,
                    new io.gs2.cdk.stamina.model.options.StaminaModelOptions()
                            .withMetadata("SPECIAL")
                            .withMaxCapacity(999)
                            .withMaxStaminaTable(new io.gs2.cdk.stamina.model.MaxStaminaTable(
                            name = "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],
                            option: new io.gs2.cdk.stamina.model.options.MaxStaminaTableOptions()
                                .withMetadata("SPECIAL"),
                            )
                        ))
                    }
                )
            )
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Stamina.Model.Namespace(
            stack: this,
            // omission
        ).MasterData(
            new [] {
                new Gs2Cdk.Gs2Stamina.Model.StaminaModel(
                    "quest",
                    15,
                    1,
                    50,
                    true,
                    new Gs2Cdk.Gs2Stamina.Model.StaminaModelOptions {
                        metadata = "QUEST",
                        maxCapacity = 999,
                        maxStaminaTable = new Gs2Cdk.Gs2Stamina.Model.MaxStaminaTable(
                            name: "playerLevel",
                            metadata: "PLAYER_LEVEL",
                            experienceModelId: "playerLevel",
                            values: new int[] {
                                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 = new Gs2Cdk.Gs2Stamina.Model.RecoverIntervalTable(
                            name: "staminaRecoverInterval",
                            metadata: "STAMINA_RECOVER_INTERVAL",
                            experienceModelId: "playerLevel",
                            values: new int[] {
                                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 = new Gs2Cdk.Gs2Stamina.Model.RecoverValueTable(
                            name: "staminaRecoverValue",
                            metadata: "STAMINA_RECOVER_VALUE",
                            experienceModelId: "playerLevel",
                            values: new int[] {
                                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.StaminaModelOptions {
                        metadata = "RAID_BATTLE"
                    }
                );,
                new Gs2Cdk.Gs2Stamina.Model.StaminaModel(
                    "special",
                    30,
                    3,
                    100,
                    true,
                    new Gs2Cdk.Gs2Stamina.Model.StaminaModelOptions {
                        metadata = "SPECIAL",
                        maxCapacity = 999,
                        maxStaminaTable = new Gs2Cdk.Gs2Stamina.Model.MaxStaminaTable(
                            name: "special",
                            metadata: "SPECIAL",
                            experienceModelId: "special",
                            values: new int[] {
                                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
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: new stamina.model.MaxStaminaTable(
                            "playerLevel",
                            "PLAYER_LEVEL",
                            "playerLevel",
                            new number[
                                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: new stamina.model.RecoverIntervalTable(
                            "staminaRecoverInterval",
                            "STAMINA_RECOVER_INTERVAL",
                            "playerLevel",
                            new number[
                                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: new stamina.model.RecoverValueTable(
                            "staminaRecoverValue",
                            "STAMINA_RECOVER_VALUE",
                            "playerLevel",
                            new number[
                                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: new stamina.model.MaxStaminaTable(
                            "special",
                            "SPECIAL",
                            "special",
                            new number[
                                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
from gs2_cdk import Stack, core, stamina

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        stamina.Namespace(
            stack=self,
            # omission
        ).master_data(
            stamina_models=[
                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=stamina.MaxStaminaTable(
                            name='playerLevel',
                            metadata='PLAYER_LEVEL',
                            experience_model_id='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=stamina.RecoverIntervalTable(
                            name='staminaRecoverInterval',
                            metadata='STAMINA_RECOVER_INTERVAL',
                            experience_model_id='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=stamina.RecoverValueTable(
                            name='staminaRecoverValue',
                            metadata='STAMINA_RECOVER_VALUE',
                            experience_model_id='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=stamina.MaxStaminaTable(
                            name='special',
                            metadata='SPECIAL',
                            experience_model_id='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

GitHubCheckoutSetting

Setup to check out master data from GitHub

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

Enumeration type definition to specify as referenceType

Enumerator String DefinitionDescription
commit_hashCommit hash
branchBranch
tagTag

LogSetting

Log setting

This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.

TypeRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

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.

On the other hand, asynchronous execution does not block 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. However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.

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.

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

Enumeration type definition to specify as doneTriggerTargetType

Enumerator String DefinitionDescription
noneNone
gs2_scriptGS2-Script
awsAmazon EventBridge