From 51797163776443fc550170691c6e039a4a3c8aa3 Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Wed, 1 Feb 2023 13:59:55 +0100 Subject: [PATCH 1/2] feat(template): support optional parameters --- cloudformation/template.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cloudformation/template.go b/cloudformation/template.go index 08e2088578..4a6553acee 100644 --- a/cloudformation/template.go +++ b/cloudformation/template.go @@ -25,24 +25,24 @@ type Template struct { } type Parameter struct { - Type string `json:"Type"` - Description string `json:"Description,omitempty"` - Default interface{} `json:"Default,omitempty"` - AllowedPattern string `json:"AllowedPattern,omitempty"` - AllowedValues []interface{} `json:"AllowedValues,omitempty"` - ConstraintDescription string `json:"ConstraintDescription,omitempty"` - MaxLength int `json:"MaxLength,omitempty"` - MinLength int `json:"MinLength,omitempty"` - MaxValue float64 `json:"MaxValue,omitempty"` - MinValue float64 `json:"MinValue,omitempty"` - NoEcho bool `json:"NoEcho,omitempty"` + Type string `json:"Type"` + Description *string `json:"Description,omitempty"` + Default *interface{} `json:"Default,omitempty"` + AllowedPattern *string `json:"AllowedPattern,omitempty"` + AllowedValues *[]interface{} `json:"AllowedValues,omitempty"` + ConstraintDescription *string `json:"ConstraintDescription,omitempty"` + MaxLength *int `json:"MaxLength,omitempty"` + MinLength *int `json:"MinLength,omitempty"` + MaxValue *float64 `json:"MaxValue,omitempty"` + MinValue *float64 `json:"MinValue,omitempty"` + NoEcho *bool `json:"NoEcho,omitempty"` } type Output struct { Value interface{} `json:"Value"` - Description string `json:"Description,omitempty"` + Description *string `json:"Description,omitempty"` Export *Export `json:"Export,omitempty"` - Condition string `json:"Condition,omitempty"` + Condition *string `json:"Condition,omitempty"` } type Export struct { From 935d928e29800b9689a22d098a55866049dedfad Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Tue, 14 Feb 2023 14:53:36 +0100 Subject: [PATCH 2/2] fix: unecessary pointers --- cloudformation/template.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cloudformation/template.go b/cloudformation/template.go index 4a6553acee..f2bccc0817 100644 --- a/cloudformation/template.go +++ b/cloudformation/template.go @@ -25,17 +25,17 @@ type Template struct { } type Parameter struct { - Type string `json:"Type"` - Description *string `json:"Description,omitempty"` - Default *interface{} `json:"Default,omitempty"` - AllowedPattern *string `json:"AllowedPattern,omitempty"` - AllowedValues *[]interface{} `json:"AllowedValues,omitempty"` - ConstraintDescription *string `json:"ConstraintDescription,omitempty"` - MaxLength *int `json:"MaxLength,omitempty"` - MinLength *int `json:"MinLength,omitempty"` - MaxValue *float64 `json:"MaxValue,omitempty"` - MinValue *float64 `json:"MinValue,omitempty"` - NoEcho *bool `json:"NoEcho,omitempty"` + Type string `json:"Type"` + Description *string `json:"Description,omitempty"` + Default interface{} `json:"Default,omitempty"` + AllowedPattern *string `json:"AllowedPattern,omitempty"` + AllowedValues []interface{} `json:"AllowedValues,omitempty"` + ConstraintDescription *string `json:"ConstraintDescription,omitempty"` + MaxLength *int `json:"MaxLength,omitempty"` + MinLength *int `json:"MinLength,omitempty"` + MaxValue *float64 `json:"MaxValue,omitempty"` + MinValue *float64 `json:"MinValue,omitempty"` + NoEcho *bool `json:"NoEcho,omitempty"` } type Output struct {