summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-04-27 20:02:42 +0200
committerNejc Habjan <hab.nejc@gmail.com>2021-04-27 20:25:32 +0200
commit603a351c71196a7f516367fbf90519f9452f3c55 (patch)
tree2c9f7c1a6119699b872210b551ffa2e026de3b25
parenta6b6cd4b598ab6eddcf3986486d43e5cdc990e09 (diff)
downloadgitlab-fix/missing-list-attributes.tar.gz
fix(objects): allow lists for filters for in all objectsfix/missing-list-attributes
-rw-r--r--gitlab/v4/objects/deploy_tokens.py3
-rw-r--r--gitlab/v4/objects/groups.py3
-rw-r--r--gitlab/v4/objects/issues.py4
-rw-r--r--gitlab/v4/objects/members.py4
-rw-r--r--gitlab/v4/objects/merge_requests.py26
-rw-r--r--gitlab/v4/objects/milestones.py4
-rw-r--r--gitlab/v4/objects/projects.py3
-rw-r--r--gitlab/v4/objects/runners.py9
-rw-r--r--gitlab/v4/objects/settings.py15
-rw-r--r--gitlab/v4/objects/users.py3
10 files changed, 62 insertions, 12 deletions
diff --git a/gitlab/v4/objects/deploy_tokens.py b/gitlab/v4/objects/deploy_tokens.py
index 59cccd4..c747664 100644
--- a/gitlab/v4/objects/deploy_tokens.py
+++ b/gitlab/v4/objects/deploy_tokens.py
@@ -1,3 +1,4 @@
+from gitlab import types
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
@@ -39,6 +40,7 @@ class GroupDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager):
"username",
),
)
+ _types = {"scopes": types.ListAttribute}
class ProjectDeployToken(ObjectDeleteMixin, RESTObject):
@@ -59,3 +61,4 @@ class ProjectDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager
"username",
),
)
+ _types = {"scopes": types.ListAttribute}
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index bc83889..4a5b245 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -244,7 +244,7 @@ class GroupManager(CRUDMixin, RESTManager):
"default_branch_protection",
),
)
- _types = {"avatar": types.ImageAttribute}
+ _types = {"avatar": types.ImageAttribute, "skip_groups": types.ListAttribute}
@exc.on_http_error(exc.GitlabImportError)
def import_group(self, file, path, name, parent_id=None, **kwargs):
@@ -293,3 +293,4 @@ class GroupSubgroupManager(ListMixin, RESTManager):
"owned",
"with_custom_attributes",
)
+ _types = {"skip_groups": types.ListAttribute}
diff --git a/gitlab/v4/objects/issues.py b/gitlab/v4/objects/issues.py
index c3c35d3..bf0e766 100644
--- a/gitlab/v4/objects/issues.py
+++ b/gitlab/v4/objects/issues.py
@@ -62,7 +62,7 @@ class IssueManager(RetrieveMixin, RESTManager):
"updated_after",
"updated_before",
)
- _types = {"labels": types.ListAttribute}
+ _types = {"iids": types.ListAttribute, "labels": types.ListAttribute}
class GroupIssue(RESTObject):
@@ -89,7 +89,7 @@ class GroupIssueManager(ListMixin, RESTManager):
"updated_after",
"updated_before",
)
- _types = {"labels": types.ListAttribute}
+ _types = {"iids": types.ListAttribute, "labels": types.ListAttribute}
class ProjectIssue(
diff --git a/gitlab/v4/objects/members.py b/gitlab/v4/objects/members.py
index 2bb9d54..2686587 100644
--- a/gitlab/v4/objects/members.py
+++ b/gitlab/v4/objects/members.py
@@ -1,4 +1,4 @@
-from gitlab import cli
+from gitlab import cli, types
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
@@ -26,6 +26,7 @@ class GroupMemberManager(CRUDMixin, RESTManager):
_update_attrs = RequiredOptional(
required=("access_level",), optional=("expires_at",)
)
+ _types = {"user_ids": types.ListAttribute}
@cli.register_custom_action("GroupMemberManager")
@exc.on_http_error(exc.GitlabListError)
@@ -67,6 +68,7 @@ class ProjectMemberManager(CRUDMixin, RESTManager):
_update_attrs = RequiredOptional(
required=("access_level",), optional=("expires_at",)
)
+ _types = {"user_ids": types.ListAttribute}
@cli.register_custom_action("ProjectMemberManager")
@exc.on_http_error(exc.GitlabListError)
diff --git a/gitlab/v4/objects/merge_requests.py b/gitlab/v4/objects/merge_requests.py
index 6c166b8..711a95f 100644
--- a/gitlab/v4/objects/merge_requests.py
+++ b/gitlab/v4/objects/merge_requests.py
@@ -62,13 +62,19 @@ class MergeRequestManager(ListMixin, RESTManager):
"scope",
"author_id",
"assignee_id",
+ "approver_ids",
+ "approved_by_ids",
"my_reaction_emoji",
"source_branch",
"target_branch",
"search",
"wip",
)
- _types = {"labels": types.ListAttribute}
+ _types = {
+ "approver_ids": types.ListAttribute,
+ "approved_by_ids": types.ListAttribute,
+ "labels": types.ListAttribute,
+ }
class GroupMergeRequest(RESTObject):
@@ -93,13 +99,19 @@ class GroupMergeRequestManager(ListMixin, RESTManager):
"scope",
"author_id",
"assignee_id",
+ "approver_ids",
+ "approved_by_ids",
"my_reaction_emoji",
"source_branch",
"target_branch",
"search",
"wip",
)
- _types = {"labels": types.ListAttribute}
+ _types = {
+ "approver_ids": types.ListAttribute,
+ "approved_by_ids": types.ListAttribute,
+ "labels": types.ListAttribute,
+ }
class ProjectMergeRequest(
@@ -377,15 +389,23 @@ class ProjectMergeRequestManager(CRUDMixin, RESTManager):
"updated_after",
"updated_before",
"scope",
+ "iids",
"author_id",
"assignee_id",
+ "approver_ids",
+ "approved_by_ids",
"my_reaction_emoji",
"source_branch",
"target_branch",
"search",
"wip",
)
- _types = {"labels": types.ListAttribute}
+ _types = {
+ "approver_ids": types.ListAttribute,
+ "approved_by_ids": types.ListAttribute,
+ "iids": types.ListAttribute,
+ "labels": types.ListAttribute,
+ }
class ProjectMergeRequestDiff(RESTObject):
diff --git a/gitlab/v4/objects/milestones.py b/gitlab/v4/objects/milestones.py
index 463fbf6..5dded37 100644
--- a/gitlab/v4/objects/milestones.py
+++ b/gitlab/v4/objects/milestones.py
@@ -1,4 +1,4 @@
-from gitlab import cli
+from gitlab import cli, types
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject, RESTObjectList
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
@@ -86,6 +86,7 @@ class GroupMilestoneManager(CRUDMixin, RESTManager):
optional=("title", "description", "due_date", "start_date", "state_event"),
)
_list_filters = ("iids", "state", "search")
+ _types = {"iids": types.ListAttribute}
class ProjectMilestone(SaveMixin, ObjectDeleteMixin, RESTObject):
@@ -159,3 +160,4 @@ class ProjectMilestoneManager(CRUDMixin, RESTManager):
optional=("title", "description", "due_date", "start_date", "state_event"),
)
_list_filters = ("iids", "state", "search")
+ _types = {"iids": types.ListAttribute}
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py
index 3dba95d..4618292 100644
--- a/gitlab/v4/objects/projects.py
+++ b/gitlab/v4/objects/projects.py
@@ -676,7 +676,6 @@ class ProjectManager(CRUDMixin, RESTManager):
"service_desk_enabled",
),
)
- _types = {"avatar": types.ImageAttribute}
_list_filters = (
"archived",
"id_after",
@@ -695,6 +694,7 @@ class ProjectManager(CRUDMixin, RESTManager):
"sort",
"starred",
"statistics",
+ "topic",
"visibility",
"wiki_checksum_failed",
"with_custom_attributes",
@@ -702,6 +702,7 @@ class ProjectManager(CRUDMixin, RESTManager):
"with_merge_requests_enabled",
"with_programming_language",
)
+ _types = {"avatar": types.ImageAttribute, "topic": types.ListAttribute}
def import_project(
self,
diff --git a/gitlab/v4/objects/runners.py b/gitlab/v4/objects/runners.py
index e6ac511..15875ab 100644
--- a/gitlab/v4/objects/runners.py
+++ b/gitlab/v4/objects/runners.py
@@ -1,4 +1,4 @@
-from gitlab import cli
+from gitlab import cli, types
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import (
@@ -40,7 +40,6 @@ class Runner(SaveMixin, ObjectDeleteMixin, RESTObject):
class RunnerManager(CRUDMixin, RESTManager):
_path = "/runners"
_obj_cls = Runner
- _list_filters = ("scope",)
_create_attrs = RequiredOptional(
required=("token",),
optional=(
@@ -65,6 +64,8 @@ class RunnerManager(CRUDMixin, RESTManager):
"maximum_timeout",
),
)
+ _list_filters = ("scope", "tag_list")
+ _types = {"tag_list": types.ListAttribute}
@cli.register_custom_action("RunnerManager", tuple(), ("scope",))
@exc.on_http_error(exc.GitlabListError)
@@ -122,6 +123,8 @@ class GroupRunnerManager(NoUpdateMixin, RESTManager):
_obj_cls = GroupRunner
_from_parent_attrs = {"group_id": "id"}
_create_attrs = RequiredOptional(required=("runner_id",))
+ _list_filters = ("scope", "tag_list")
+ _types = {"tag_list": types.ListAttribute}
class ProjectRunner(ObjectDeleteMixin, RESTObject):
@@ -133,3 +136,5 @@ class ProjectRunnerManager(NoUpdateMixin, RESTManager):
_obj_cls = ProjectRunner
_from_parent_attrs = {"project_id": "id"}
_create_attrs = RequiredOptional(required=("runner_id",))
+ _list_filters = ("scope", "tag_list")
+ _types = {"tag_list": types.ListAttribute}
diff --git a/gitlab/v4/objects/settings.py b/gitlab/v4/objects/settings.py
index a3d6ed9..6b7537b 100644
--- a/gitlab/v4/objects/settings.py
+++ b/gitlab/v4/objects/settings.py
@@ -1,3 +1,4 @@
+from gitlab import types
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin
@@ -35,13 +36,18 @@ class ApplicationSettingsManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
"default_snippet_visibility",
"default_group_visibility",
"outbound_local_requests_whitelist",
+ "disabled_oauth_sign_in_sources",
"domain_whitelist",
"domain_blacklist_enabled",
"domain_blacklist",
+ "domain_allowlist",
+ "domain_denylist_enabled",
+ "domain_denylist",
"external_authorization_service_enabled",
"external_authorization_service_url",
"external_authorization_service_default_label",
"external_authorization_service_timeout",
+ "import_sources",
"user_oauth_applications",
"after_sign_out_path",
"container_registry_token_expire_delay",
@@ -65,12 +71,21 @@ class ApplicationSettingsManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
"asset_proxy_enabled",
"asset_proxy_url",
"asset_proxy_whitelist",
+ "asset_proxy_allowlist",
"geo_node_allowed_ips",
"allow_local_requests_from_hooks_and_services",
"allow_local_requests_from_web_hooks_and_services",
"allow_local_requests_from_system_hooks",
),
)
+ _types = {
+ "asset_proxy_allowlist": types.ListAttribute,
+ "disabled_oauth_sign_in_sources": types.ListAttribute,
+ "domain_allowlist": types.ListAttribute,
+ "domain_denylist": types.ListAttribute,
+ "import_sources": types.ListAttribute,
+ "restricted_visibility_levels": types.ListAttribute,
+ }
@exc.on_http_error(exc.GitlabUpdateError)
def update(self, id=None, new_data=None, **kwargs):
diff --git a/gitlab/v4/objects/users.py b/gitlab/v4/objects/users.py
index c90a7c9..8a8db71 100644
--- a/gitlab/v4/objects/users.py
+++ b/gitlab/v4/objects/users.py
@@ -328,7 +328,8 @@ class ProjectUserManager(ListMixin, RESTManager):
_path = "/projects/%(project_id)s/users"
_obj_cls = ProjectUser
_from_parent_attrs = {"project_id": "id"}
- _list_filters = ("search",)
+ _list_filters = ("search", "skip_users")
+ _types = {"skip_users": types.ListAttribute}
class UserEmail(ObjectDeleteMixin, RESTObject):