From 1256139f16512f3c1e7d35216adeba8f135f0aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=99=93=E4=BC=9F?= Date: Tue, 16 Jan 2024 10:10:36 +0800 Subject: [PATCH 1/2] :sparkles: Project-level CI/CD variables API: add description https://docs.gitlab.com/ee/api/project_level_variables.html --- project_variables.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project_variables.go b/project_variables.go index 2a16f5a7e..f8ad278f5 100644 --- a/project_variables.go +++ b/project_variables.go @@ -43,6 +43,7 @@ type ProjectVariable struct { Masked bool `json:"masked"` Raw bool `json:"raw"` EnvironmentScope string `json:"environment_scope"` + Description string `json:"description"` } func (v ProjectVariable) String() string { @@ -133,6 +134,7 @@ type CreateProjectVariableOptions struct { Masked *bool `url:"masked,omitempty" json:"masked,omitempty"` Raw *bool `url:"raw,omitempty" json:"raw,omitempty"` EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` + Description *string `url:"description,omitempty" json:"description,omitempty"` } // CreateVariable creates a new project variable. @@ -173,6 +175,7 @@ type UpdateProjectVariableOptions struct { Raw *bool `url:"raw,omitempty" json:"raw,omitempty"` EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` Filter *VariableFilter `url:"filter,omitempty" json:"filter,omitempty"` + Description *string `url:"description,omitempty" json:"description,omitempty"` } // UpdateVariable updates a project's variable. From 8e7e14beddb59d57aa5ad5d08f0593146b625bd9 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Tue, 16 Jan 2024 08:52:15 +0100 Subject: [PATCH 2/2] Update ordering --- project_variables.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/project_variables.go b/project_variables.go index f8ad278f5..e75c74634 100644 --- a/project_variables.go +++ b/project_variables.go @@ -129,12 +129,12 @@ func (s *ProjectVariablesService) GetVariable(pid interface{}, key string, opt * type CreateProjectVariableOptions struct { Key *string `url:"key,omitempty" json:"key,omitempty"` Value *string `url:"value,omitempty" json:"value,omitempty"` - VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"` - Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` + Description *string `url:"description,omitempty" json:"description,omitempty"` + EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` Masked *bool `url:"masked,omitempty" json:"masked,omitempty"` + Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` Raw *bool `url:"raw,omitempty" json:"raw,omitempty"` - EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` - Description *string `url:"description,omitempty" json:"description,omitempty"` + VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"` } // CreateVariable creates a new project variable. @@ -169,13 +169,13 @@ func (s *ProjectVariablesService) CreateVariable(pid interface{}, opt *CreatePro // https://docs.gitlab.com/ee/api/project_level_variables.html#update-a-variable type UpdateProjectVariableOptions struct { Value *string `url:"value,omitempty" json:"value,omitempty"` - VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"` - Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` - Masked *bool `url:"masked,omitempty" json:"masked,omitempty"` - Raw *bool `url:"raw,omitempty" json:"raw,omitempty"` + Description *string `url:"description,omitempty" json:"description,omitempty"` EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` Filter *VariableFilter `url:"filter,omitempty" json:"filter,omitempty"` - Description *string `url:"description,omitempty" json:"description,omitempty"` + Masked *bool `url:"masked,omitempty" json:"masked,omitempty"` + Protected *bool `url:"protected,omitempty" json:"protected,omitempty"` + Raw *bool `url:"raw,omitempty" json:"raw,omitempty"` + VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"` } // UpdateVariable updates a project's variable.