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

Commit 0cb05aa

Browse files
committed
Revert name as per GitLab API
1 parent 2a04814 commit 0cb05aa

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

group_variables.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type GroupVariable struct {
4141
VariableType VariableTypeValue `json:"variable_type"`
4242
Protected bool `json:"protected"`
4343
Masked bool `json:"masked"`
44-
Hidden bool `json:"hidden"`
44+
MaskedAndHidden bool `json:"masked_and_hidden"`
4545
Raw bool `json:"raw"`
4646
EnvironmentScope string `json:"environment_scope"`
4747
Description string `json:"description"`
@@ -128,7 +128,7 @@ type CreateGroupVariableOptions struct {
128128
Description *string `url:"description,omitempty" json:"description,omitempty"`
129129
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
130130
Masked *bool `url:"masked,omitempty" json:"masked,omitempty"`
131-
Hidden *bool `url:"hidden,omitempty" json:"hidden,omitempty"`
131+
MaskedAndHidden *bool `url:"masked_and_hidden,omitempty" json:"hidden,omitempty"`
132132
Protected *bool `url:"protected,omitempty" json:"protected,omitempty"`
133133
Raw *bool `url:"raw,omitempty" json:"raw,omitempty"`
134134
VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"`

group_variables_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestListGroupVariabless(t *testing.T) {
2929
mux.HandleFunc("/api/v4/groups/1/variables",
3030
func(w http.ResponseWriter, r *http.Request) {
3131
testMethod(t, r, http.MethodGet)
32-
fmt.Fprint(w, `[{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden": true}]`)
32+
fmt.Fprint(w, `[{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"masked_and_hidden": true}]`)
3333
})
3434

3535
variables, _, err := client.GroupVariables.ListVariables(1, &ListGroupVariablesOptions{})
@@ -39,11 +39,11 @@ func TestListGroupVariabless(t *testing.T) {
3939

4040
want := []*GroupVariable{
4141
{
42-
Key: "TEST_VARIABLE_1",
43-
Value: "test1",
44-
Protected: false,
45-
Masked: true,
46-
Hidden: true,
42+
Key: "TEST_VARIABLE_1",
43+
Value: "test1",
44+
Protected: false,
45+
Masked: true,
46+
MaskedAndHidden: true,
4747
},
4848
}
4949

@@ -59,15 +59,15 @@ func TestGetGroupVariable(t *testing.T) {
5959
func(w http.ResponseWriter, r *http.Request) {
6060
testMethod(t, r, http.MethodGet)
6161
testParams(t, r, "filter%5Benvironment_scope%5D=prod")
62-
fmt.Fprint(w, `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden": true}`)
62+
fmt.Fprint(w, `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"masked_and_hidden": true}`)
6363
})
6464

6565
variable, _, err := client.GroupVariables.GetVariable(1, "TEST_VARIABLE_1", &GetGroupVariableOptions{Filter: &VariableFilter{EnvironmentScope: "prod"}})
6666
if err != nil {
6767
t.Errorf("GroupVariables.GetVariable returned error: %v", err)
6868
}
6969

70-
want := &GroupVariable{Key: "TEST_VARIABLE_1", Value: "test1", Protected: false, Masked: true, Hidden: true}
70+
want := &GroupVariable{Key: "TEST_VARIABLE_1", Value: "test1", Protected: false, Masked: true, MaskedAndHidden: true}
7171
if !reflect.DeepEqual(want, variable) {
7272
t.Errorf("GroupVariables.GetVariable returned %+v, want %+v", variable, want)
7373
}
@@ -79,23 +79,23 @@ func TestCreateGroupVariable(t *testing.T) {
7979
mux.HandleFunc("/api/v4/groups/1/variables",
8080
func(w http.ResponseWriter, r *http.Request) {
8181
testMethod(t, r, http.MethodPost)
82-
fmt.Fprint(w, `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden": true}`)
82+
fmt.Fprint(w, `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"masked_and_hidden": true}`)
8383
})
8484

8585
opt := &CreateGroupVariableOptions{
86-
Key: Ptr("TEST_VARIABLE_1"),
87-
Value: Ptr("test1"),
88-
Protected: Ptr(false),
89-
Masked: Ptr(true),
90-
Hidden: Ptr(true),
86+
Key: Ptr("TEST_VARIABLE_1"),
87+
Value: Ptr("test1"),
88+
Protected: Ptr(false),
89+
Masked: Ptr(true),
90+
MaskedAndHidden: Ptr(true),
9191
}
9292

9393
variable, _, err := client.GroupVariables.CreateVariable(1, opt, nil)
9494
if err != nil {
9595
t.Errorf("GroupVariables.CreateVariable returned error: %v", err)
9696
}
9797

98-
want := &GroupVariable{Key: "TEST_VARIABLE_1", Value: "test1", Protected: false, Masked: true, Hidden: true}
98+
want := &GroupVariable{Key: "TEST_VARIABLE_1", Value: "test1", Protected: false, Masked: true, MaskedAndHidden: true}
9999
if !reflect.DeepEqual(want, variable) {
100100
t.Errorf("GroupVariables.CreateVariable returned %+v, want %+v", variable, want)
101101
}
@@ -128,15 +128,15 @@ func TestUpdateGroupVariable(t *testing.T) {
128128
mux.HandleFunc("/api/v4/groups/1/variables/TEST_VARIABLE_1",
129129
func(w http.ResponseWriter, r *http.Request) {
130130
testMethod(t, r, http.MethodPut)
131-
fmt.Fprint(w, `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden": false}`)
131+
fmt.Fprint(w, `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true}`)
132132
})
133133

134134
variable, _, err := client.GroupVariables.UpdateVariable(1, "TEST_VARIABLE_1", &UpdateGroupVariableOptions{})
135135
if err != nil {
136136
t.Errorf("GroupVariables.UpdateVariable returned error: %v", err)
137137
}
138138

139-
want := &GroupVariable{Key: "TEST_VARIABLE_1", Value: "test1", Protected: false, Masked: true, Hidden: false}
139+
want := &GroupVariable{Key: "TEST_VARIABLE_1", Value: "test1", Protected: false, Masked: true}
140140
if !reflect.DeepEqual(want, variable) {
141141
t.Errorf("Groups.UpdatedGroup returned %+v, want %+v", variable, want)
142142
}

0 commit comments

Comments
 (0)