Skip to content

Commit f968e2c

Browse files
committed
feat(api): add 'masked_and_hidden' to the optional variable create attrs
fix(api): make 'value' an optional variable update attr
1 parent 2783883 commit f968e2c

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

gitlab/v4/objects/variables.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ class VariableManager(CRUDMixin[Variable]):
2727
_path = "/admin/ci/variables"
2828
_obj_cls = Variable
2929
_create_attrs = RequiredOptional(
30-
required=("key", "value"), optional=("protected", "variable_type", "masked")
30+
required=("key", "value"),
31+
optional=("protected", "variable_type", "masked", "masked_and_hidden"),
3132
)
3233
_update_attrs = RequiredOptional(
33-
required=("key", "value"), optional=("protected", "variable_type", "masked")
34+
required=("key",), optional=("value", "protected", "variable_type", "masked")
3435
)
3536

3637

@@ -43,10 +44,11 @@ class GroupVariableManager(CRUDMixin[GroupVariable]):
4344
_obj_cls = GroupVariable
4445
_from_parent_attrs = {"group_id": "id"}
4546
_create_attrs = RequiredOptional(
46-
required=("key", "value"), optional=("protected", "variable_type", "masked")
47+
required=("key", "value"),
48+
optional=("protected", "variable_type", "masked", "masked_and_hidden"),
4749
)
4850
_update_attrs = RequiredOptional(
49-
required=("key", "value"), optional=("protected", "variable_type", "masked")
51+
required=("key",), optional=("value", "protected", "variable_type", "masked")
5052
)
5153

5254

@@ -60,9 +62,15 @@ class ProjectVariableManager(CRUDMixin[ProjectVariable]):
6062
_from_parent_attrs = {"project_id": "id"}
6163
_create_attrs = RequiredOptional(
6264
required=("key", "value"),
63-
optional=("protected", "variable_type", "masked", "environment_scope"),
65+
optional=(
66+
"protected",
67+
"variable_type",
68+
"masked",
69+
"environment_scope",
70+
"masked_and_hidden",
71+
),
6472
)
6573
_update_attrs = RequiredOptional(
66-
required=("key", "value"),
67-
optional=("protected", "variable_type", "masked", "environment_scope"),
74+
required=("key",),
75+
optional=("value", "protected", "variable_type", "masked", "environment_scope"),
6876
)

0 commit comments

Comments
 (0)