Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Add support for hidden field to project variables #2065

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions project_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ProjectVariable struct {
VariableType VariableTypeValue `json:"variable_type"`
Protected bool `json:"protected"`
Masked bool `json:"masked"`
Hidden bool `json:"hidden"`
Raw bool `json:"raw"`
EnvironmentScope string `json:"environment_scope"`
Description string `json:"description"`
Expand Down Expand Up @@ -132,6 +133,7 @@ type CreateProjectVariableOptions struct {
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"`
Hidden *bool `url:"hidden,omitempty" json:"hidden,omitempty"`
yogeshlonkar marked this conversation as resolved.
Show resolved Hide resolved
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"`
Expand Down Expand Up @@ -173,6 +175,7 @@ type UpdateProjectVariableOptions struct {
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
Filter *VariableFilter `url:"filter,omitempty" json:"filter,omitempty"`
Masked *bool `url:"masked,omitempty" json:"masked,omitempty"`
Hidden *bool `url:"hidden,omitempty" json:"hidden,omitempty"`
yogeshlonkar marked this conversation as resolved.
Show resolved Hide resolved
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"`
Expand Down
7 changes: 7 additions & 0 deletions project_variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func TestProjectVariablesService_ListVariables(t *testing.T) {
VariableType: "env_var",
Protected: false,
Masked: false,
Hidden: false,
EnvironmentScope: "",
Description: "test variable 1",
}}
Expand Down Expand Up @@ -69,6 +70,7 @@ func TestProjectVariablesService_GetVariable(t *testing.T) {
"value": "TEST_1",
"protected": false,
"masked": true,
"hidden": true,
"description": "test variable 1"
}
`)
Expand All @@ -80,6 +82,7 @@ func TestProjectVariablesService_GetVariable(t *testing.T) {
VariableType: "env_var",
Protected: false,
Masked: true,
Hidden: true,
EnvironmentScope: "",
Description: "test variable 1",
}
Expand Down Expand Up @@ -118,6 +121,7 @@ func TestProjectVariablesService_CreateVariable(t *testing.T) {
"protected": false,
"variable_type": "env_var",
"masked": false,
"hidden": false,
"environment_scope": "*",
"description": "new variable"
}
Expand All @@ -130,6 +134,7 @@ func TestProjectVariablesService_CreateVariable(t *testing.T) {
VariableType: "env_var",
Protected: false,
Masked: false,
Hidden: false,
EnvironmentScope: "*",
Description: "new variable",
}
Expand Down Expand Up @@ -168,6 +173,7 @@ func TestProjectVariablesService_UpdateVariable(t *testing.T) {
"protected": false,
"variable_type": "env_var",
"masked": false,
"hidden": false,
"environment_scope": "*",
"description": "updated description"
}
Expand All @@ -180,6 +186,7 @@ func TestProjectVariablesService_UpdateVariable(t *testing.T) {
VariableType: "env_var",
Protected: false,
Masked: false,
Hidden: false,
EnvironmentScope: "*",
Description: "updated description",
}
Expand Down