| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 07539c9 commit 5127b15
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ def get_for_api(self) -> Any: | |||
| 32 | 32 | return self._value | |
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | - class ListAttribute(GitlabAttribute): | ||
| 35 | + class CommaSeparatedListAttribute(GitlabAttribute): | ||
| 36 | 36 | def set_from_cli(self, cli_value: str) -> None: | |
| 37 | 37 | if not cli_value.strip(): | |
| 38 | 38 | self._value = [] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ class GroupDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager): | |||
| 39 | 39 | "username", | |
| 40 | 40 | ), | |
| 41 | 41 | ) | |
| 42 | - _types = {"scopes": types.ListAttribute} | ||
| 42 | + _types = {"scopes": types.CommaSeparatedListAttribute} | ||
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | 45 | class ProjectDeployToken(ObjectDeleteMixin, RESTObject): | |
@@ -60,4 +60,4 @@ class ProjectDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager | |||
| 60 | 60 | "username", | |
| 61 | 61 | ), | |
| 62 | 62 | ) | |
| 63 | - _types = {"scopes": types.ListAttribute} | ||
| 63 | + _types = {"scopes": types.CommaSeparatedListAttribute} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,7 @@ class GroupEpicManager(CRUDMixin, RESTManager): | |||
| 42 | 42 | _update_attrs = RequiredOptional( | |
| 43 | 43 | optional=("title", "labels", "description", "start_date", "end_date"), | |
| 44 | 44 | ) | |
| 45 | - _types = {"labels": types.ListAttribute} | ||
| 45 | + _types = {"labels": types.CommaSeparatedListAttribute} | ||
| 46 | 46 | ||
| 47 | 47 | def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> GroupEpic: | |
| 48 | 48 | return cast(GroupEpic, super().get(id=id, lazy=lazy, **kwargs)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -314,7 +314,10 @@ class GroupManager(CRUDMixin, RESTManager): | |||
| 314 | 314 | "shared_runners_setting", | |
| 315 | 315 | ), | |
| 316 | 316 | ) | |
| 317 | - _types = {"avatar": types.ImageAttribute, "skip_groups": types.ListAttribute} | ||
| 317 | + _types = { | ||
| 318 | + "avatar": types.ImageAttribute, | ||
| 319 | + "skip_groups": types.CommaSeparatedListAttribute, | ||
| 320 | + } | ||
| 318 | 321 | ||
| 319 | 322 | def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Group: | |
| 320 | 323 | return cast(Group, super().get(id=id, lazy=lazy, **kwargs)) | |
@@ -374,7 +377,7 @@ class GroupSubgroupManager(ListMixin, RESTManager): | |||
| 374 | 377 | "with_custom_attributes", | |
| 375 | 378 | "min_access_level", | |
| 376 | 379 | ) | |
| 377 | - _types = {"skip_groups": types.ListAttribute} | ||
| 380 | + _types = {"skip_groups": types.CommaSeparatedListAttribute} | ||
| 378 | 381 | ||
| 379 | 382 | ||
| 380 | 383 | class GroupDescendantGroup(RESTObject): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,7 +65,10 @@ class IssueManager(RetrieveMixin, RESTManager): | |||
| 65 | 65 | "updated_after", | |
| 66 | 66 | "updated_before", | |
| 67 | 67 | ) | |
| 68 | - _types = {"iids": types.ListAttribute, "labels": types.ListAttribute} | ||
| 68 | + _types = { | ||
| 69 | + "iids": types.CommaSeparatedListAttribute, | ||
| 70 | + "labels": types.CommaSeparatedListAttribute, | ||
| 71 | + } | ||
| 69 | 72 | ||
| 70 | 73 | def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Issue: | |
| 71 | 74 | return cast(Issue, super().get(id=id, lazy=lazy, **kwargs)) | |
@@ -95,7 +98,10 @@ class GroupIssueManager(ListMixin, RESTManager): | |||
| 95 | 98 | "updated_after", | |
| 96 | 99 | "updated_before", | |
| 97 | 100 | ) | |
| 98 | - _types = {"iids": types.ListAttribute, "labels": types.ListAttribute} | ||
| 101 | + _types = { | ||
| 102 | + "iids": types.CommaSeparatedListAttribute, | ||
| 103 | + "labels": types.CommaSeparatedListAttribute, | ||
| 104 | + } | ||
| 99 | 105 | ||
| 100 | 106 | ||
| 101 | 107 | class ProjectIssue( | |
@@ -233,7 +239,10 @@ class ProjectIssueManager(CRUDMixin, RESTManager): | |||
| 233 | 239 | "discussion_locked", | |
| 234 | 240 | ), | |
| 235 | 241 | ) | |
| 236 | - _types = {"iids": types.ListAttribute, "labels": types.ListAttribute} | ||
| 242 | + _types = { | ||
| 243 | + "iids": types.CommaSeparatedListAttribute, | ||
| 244 | + "labels": types.CommaSeparatedListAttribute, | ||
| 245 | + } | ||
| 237 | 246 | ||
| 238 | 247 | def get( | |
| 239 | 248 | self, id: Union[str, int], lazy: bool = False, **kwargs: Any | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ class GroupMemberManager(CRUDMixin, RESTManager): | |||
| 41 | 41 | _update_attrs = RequiredOptional( | |
| 42 | 42 | required=("access_level",), optional=("expires_at",) | |
| 43 | 43 | ) | |
| 44 | - _types = {"user_ids": types.ListAttribute} | ||
| 44 | + _types = {"user_ids": types.CommaSeparatedListAttribute} | ||
| 45 | 45 | ||
| 46 | 46 | def get( | |
| 47 | 47 | self, id: Union[str, int], lazy: bool = False, **kwargs: Any | |
@@ -101,7 +101,7 @@ class ProjectMemberManager(CRUDMixin, RESTManager): | |||
| 101 | 101 | _update_attrs = RequiredOptional( | |
| 102 | 102 | required=("access_level",), optional=("expires_at",) | |
| 103 | 103 | ) | |
| 104 | - _types = {"user_ids": types.ListAttribute} | ||
| 104 | + _types = {"user_ids": types.CommaSeparatedListAttribute} | ||
| 105 | 105 | ||
| 106 | 106 | def get( | |
| 107 | 107 | self, id: Union[str, int], lazy: bool = False, **kwargs: Any | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,10 +95,10 @@ class MergeRequestManager(ListMixin, RESTManager): | |||
| 95 | 95 | "deployed_after", | |
| 96 | 96 | ) | |
| 97 | 97 | _types = { | |
| 98 | - "approver_ids": types.ListAttribute, | ||
| 99 | - "approved_by_ids": types.ListAttribute, | ||
| 100 | - "in": types.ListAttribute, | ||
| 101 | - "labels": types.ListAttribute, | ||
| 98 | + "approver_ids": types.CommaSeparatedListAttribute, | ||
| 99 | + "approved_by_ids": types.CommaSeparatedListAttribute, | ||
| 100 | + "in": types.CommaSeparatedListAttribute, | ||
| 101 | + "labels": types.CommaSeparatedListAttribute, | ||
| 102 | 102 | } | |
| 103 | 103 | ||
| 104 | 104 | ||
@@ -133,9 +133,9 @@ class GroupMergeRequestManager(ListMixin, RESTManager): | |||
| 133 | 133 | "wip", | |
| 134 | 134 | ) | |
| 135 | 135 | _types = { | |
| 136 | - "approver_ids": types.ListAttribute, | ||
| 137 | - "approved_by_ids": types.ListAttribute, | ||
| 138 | - "labels": types.ListAttribute, | ||
| 136 | + "approver_ids": types.CommaSeparatedListAttribute, | ||
| 137 | + "approved_by_ids": types.CommaSeparatedListAttribute, | ||
| 138 | + "labels": types.CommaSeparatedListAttribute, | ||
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | 141 | ||
@@ -455,10 +455,10 @@ class ProjectMergeRequestManager(CRUDMixin, RESTManager): | |||
| 455 | 455 | "wip", | |
| 456 | 456 | ) | |
| 457 | 457 | _types = { | |
| 458 | - "approver_ids": types.ListAttribute, | ||
| 459 | - "approved_by_ids": types.ListAttribute, | ||
| 460 | - "iids": types.ListAttribute, | ||
| 461 | - "labels": types.ListAttribute, | ||
| 458 | + "approver_ids": types.CommaSeparatedListAttribute, | ||
| 459 | + "approved_by_ids": types.CommaSeparatedListAttribute, | ||
| 460 | + "iids": types.CommaSeparatedListAttribute, | ||
| 461 | + "labels": types.CommaSeparatedListAttribute, | ||
| 462 | 462 | } | |
| 463 | 463 | ||
| 464 | 464 | def get( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,7 +93,7 @@ class GroupMilestoneManager(CRUDMixin, RESTManager): | |||
| 93 | 93 | optional=("title", "description", "due_date", "start_date", "state_event"), | |
| 94 | 94 | ) | |
| 95 | 95 | _list_filters = ("iids", "state", "search") | |
| 96 | - _types = {"iids": types.ListAttribute} | ||
| 96 | + _types = {"iids": types.CommaSeparatedListAttribute} | ||
| 97 | 97 | ||
| 98 | 98 | def get( | |
| 99 | 99 | self, id: Union[str, int], lazy: bool = False, **kwargs: Any | |
@@ -177,7 +177,7 @@ class ProjectMilestoneManager(CRUDMixin, RESTManager): | |||
| 177 | 177 | optional=("title", "description", "due_date", "start_date", "state_event"), | |
| 178 | 178 | ) | |
| 179 | 179 | _list_filters = ("iids", "state", "search") | |
| 180 | - _types = {"iids": types.ListAttribute} | ||
| 180 | + _types = {"iids": types.CommaSeparatedListAttribute} | ||
| 181 | 181 | ||
| 182 | 182 | def get( | |
| 183 | 183 | self, id: Union[str, int], lazy: bool = False, **kwargs: Any | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -125,7 +125,7 @@ class ProjectGroupManager(ListMixin, RESTManager): | |||
| 125 | 125 | "shared_min_access_level", | |
| 126 | 126 | "shared_visible_only", | |
| 127 | 127 | ) | |
| 128 | - _types = {"skip_groups": types.ListAttribute} | ||
| 128 | + _types = {"skip_groups": types.CommaSeparatedListAttribute} | ||
| 129 | 129 | ||
| 130 | 130 | ||
| 131 | 131 | class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTObject): | |
@@ -807,7 +807,10 @@ class ProjectManager(CRUDMixin, RESTManager): | |||
| 807 | 807 | "with_merge_requests_enabled", | |
| 808 | 808 | "with_programming_language", | |
| 809 | 809 | ) | |
| 810 | - _types = {"avatar": types.ImageAttribute, "topic": types.ListAttribute} | ||
| 810 | + _types = { | ||
| 811 | + "avatar": types.ImageAttribute, | ||
| 812 | + "topic": types.CommaSeparatedListAttribute, | ||
| 813 | + } | ||
| 811 | 814 | ||
| 812 | 815 | def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Project: | |
| 813 | 816 | return cast(Project, super().get(id=id, lazy=lazy, **kwargs)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ class RunnerManager(CRUDMixin, RESTManager): | |||
| 68 | 68 | ), | |
| 69 | 69 | ) | |
| 70 | 70 | _list_filters = ("scope", "tag_list") | |
| 71 | - _types = {"tag_list": types.ListAttribute} | ||
| 71 | + _types = {"tag_list": types.CommaSeparatedListAttribute} | ||
| 72 | 72 | ||
| 73 | 73 | @cli.register_custom_action("RunnerManager", tuple(), ("scope",)) | |
| 74 | 74 | @exc.on_http_error(exc.GitlabListError) | |
@@ -130,7 +130,7 @@ class GroupRunnerManager(ListMixin, RESTManager): | |||
| 130 | 130 | _from_parent_attrs = {"group_id": "id"} | |
| 131 | 131 | _create_attrs = RequiredOptional(required=("runner_id",)) | |
| 132 | 132 | _list_filters = ("scope", "tag_list") | |
| 133 | - _types = {"tag_list": types.ListAttribute} | ||
| 133 | + _types = {"tag_list": types.CommaSeparatedListAttribute} | ||
| 134 | 134 | ||
| 135 | 135 | ||
| 136 | 136 | class ProjectRunner(ObjectDeleteMixin, RESTObject): | |
@@ -143,4 +143,4 @@ class ProjectRunnerManager(CreateMixin, DeleteMixin, ListMixin, RESTManager): | |||
| 143 | 143 | _from_parent_attrs = {"project_id": "id"} | |
| 144 | 144 | _create_attrs = RequiredOptional(required=("runner_id",)) | |
| 145 | 145 | _list_filters = ("scope", "tag_list") | |
| 146 | - _types = {"tag_list": types.ListAttribute} | ||
| 146 | + _types = {"tag_list": types.CommaSeparatedListAttribute} | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments