Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5127b15

Browse files
chore: renametypes.ListAttribute totypes.CommaSeparatedListAttribute
This name more accurately describes what the type is. Also this is thefirst step in a series of steps of our goal to add full support forthe GitLab API data types[1]: * array * hash * array of hashes[1]https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
1 parent07539c9 commit5127b15

File tree

13 files changed

+63
-48
lines changed

13 files changed

+63
-48
lines changed

‎gitlab/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_for_api(self) -> Any:
3232
returnself._value
3333

3434

35-
classListAttribute(GitlabAttribute):
35+
classCommaSeparatedListAttribute(GitlabAttribute):
3636
defset_from_cli(self,cli_value:str)->None:
3737
ifnotcli_value.strip():
3838
self._value= []

‎gitlab/v4/objects/deploy_tokens.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class GroupDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager):
3939
"username",
4040
),
4141
)
42-
_types= {"scopes":types.ListAttribute}
42+
_types= {"scopes":types.CommaSeparatedListAttribute}
4343

4444

4545
classProjectDeployToken(ObjectDeleteMixin,RESTObject):
@@ -60,4 +60,4 @@ class ProjectDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager
6060
"username",
6161
),
6262
)
63-
_types= {"scopes":types.ListAttribute}
63+
_types= {"scopes":types.CommaSeparatedListAttribute}

‎gitlab/v4/objects/epics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class GroupEpicManager(CRUDMixin, RESTManager):
4242
_update_attrs=RequiredOptional(
4343
optional=("title","labels","description","start_date","end_date"),
4444
)
45-
_types= {"labels":types.ListAttribute}
45+
_types= {"labels":types.CommaSeparatedListAttribute}
4646

4747
defget(self,id:Union[str,int],lazy:bool=False,**kwargs:Any)->GroupEpic:
4848
returncast(GroupEpic,super().get(id=id,lazy=lazy,**kwargs))

‎gitlab/v4/objects/groups.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ class GroupManager(CRUDMixin, RESTManager):
314314
"shared_runners_setting",
315315
),
316316
)
317-
_types= {"avatar":types.ImageAttribute,"skip_groups":types.ListAttribute}
317+
_types= {
318+
"avatar":types.ImageAttribute,
319+
"skip_groups":types.CommaSeparatedListAttribute,
320+
}
318321

319322
defget(self,id:Union[str,int],lazy:bool=False,**kwargs:Any)->Group:
320323
returncast(Group,super().get(id=id,lazy=lazy,**kwargs))
@@ -374,7 +377,7 @@ class GroupSubgroupManager(ListMixin, RESTManager):
374377
"with_custom_attributes",
375378
"min_access_level",
376379
)
377-
_types= {"skip_groups":types.ListAttribute}
380+
_types= {"skip_groups":types.CommaSeparatedListAttribute}
378381

379382

380383
classGroupDescendantGroup(RESTObject):

‎gitlab/v4/objects/issues.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ class IssueManager(RetrieveMixin, RESTManager):
6565
"updated_after",
6666
"updated_before",
6767
)
68-
_types= {"iids":types.ListAttribute,"labels":types.ListAttribute}
68+
_types= {
69+
"iids":types.CommaSeparatedListAttribute,
70+
"labels":types.CommaSeparatedListAttribute,
71+
}
6972

7073
defget(self,id:Union[str,int],lazy:bool=False,**kwargs:Any)->Issue:
7174
returncast(Issue,super().get(id=id,lazy=lazy,**kwargs))
@@ -95,7 +98,10 @@ class GroupIssueManager(ListMixin, RESTManager):
9598
"updated_after",
9699
"updated_before",
97100
)
98-
_types= {"iids":types.ListAttribute,"labels":types.ListAttribute}
101+
_types= {
102+
"iids":types.CommaSeparatedListAttribute,
103+
"labels":types.CommaSeparatedListAttribute,
104+
}
99105

100106

101107
classProjectIssue(
@@ -233,7 +239,10 @@ class ProjectIssueManager(CRUDMixin, RESTManager):
233239
"discussion_locked",
234240
),
235241
)
236-
_types= {"iids":types.ListAttribute,"labels":types.ListAttribute}
242+
_types= {
243+
"iids":types.CommaSeparatedListAttribute,
244+
"labels":types.CommaSeparatedListAttribute,
245+
}
237246

238247
defget(
239248
self,id:Union[str,int],lazy:bool=False,**kwargs:Any

‎gitlab/v4/objects/members.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class GroupMemberManager(CRUDMixin, RESTManager):
4141
_update_attrs=RequiredOptional(
4242
required=("access_level",),optional=("expires_at",)
4343
)
44-
_types= {"user_ids":types.ListAttribute}
44+
_types= {"user_ids":types.CommaSeparatedListAttribute}
4545

4646
defget(
4747
self,id:Union[str,int],lazy:bool=False,**kwargs:Any
@@ -101,7 +101,7 @@ class ProjectMemberManager(CRUDMixin, RESTManager):
101101
_update_attrs=RequiredOptional(
102102
required=("access_level",),optional=("expires_at",)
103103
)
104-
_types= {"user_ids":types.ListAttribute}
104+
_types= {"user_ids":types.CommaSeparatedListAttribute}
105105

106106
defget(
107107
self,id:Union[str,int],lazy:bool=False,**kwargs:Any

‎gitlab/v4/objects/merge_requests.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ class MergeRequestManager(ListMixin, RESTManager):
9595
"deployed_after",
9696
)
9797
_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,
102102
}
103103

104104

@@ -133,9 +133,9 @@ class GroupMergeRequestManager(ListMixin, RESTManager):
133133
"wip",
134134
)
135135
_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,
139139
}
140140

141141

@@ -455,10 +455,10 @@ class ProjectMergeRequestManager(CRUDMixin, RESTManager):
455455
"wip",
456456
)
457457
_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,
462462
}
463463

464464
defget(

‎gitlab/v4/objects/milestones.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class GroupMilestoneManager(CRUDMixin, RESTManager):
9393
optional=("title","description","due_date","start_date","state_event"),
9494
)
9595
_list_filters= ("iids","state","search")
96-
_types= {"iids":types.ListAttribute}
96+
_types= {"iids":types.CommaSeparatedListAttribute}
9797

9898
defget(
9999
self,id:Union[str,int],lazy:bool=False,**kwargs:Any
@@ -177,7 +177,7 @@ class ProjectMilestoneManager(CRUDMixin, RESTManager):
177177
optional=("title","description","due_date","start_date","state_event"),
178178
)
179179
_list_filters= ("iids","state","search")
180-
_types= {"iids":types.ListAttribute}
180+
_types= {"iids":types.CommaSeparatedListAttribute}
181181

182182
defget(
183183
self,id:Union[str,int],lazy:bool=False,**kwargs:Any

‎gitlab/v4/objects/projects.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class ProjectGroupManager(ListMixin, RESTManager):
125125
"shared_min_access_level",
126126
"shared_visible_only",
127127
)
128-
_types= {"skip_groups":types.ListAttribute}
128+
_types= {"skip_groups":types.CommaSeparatedListAttribute}
129129

130130

131131
classProject(RefreshMixin,SaveMixin,ObjectDeleteMixin,RepositoryMixin,RESTObject):
@@ -807,7 +807,10 @@ class ProjectManager(CRUDMixin, RESTManager):
807807
"with_merge_requests_enabled",
808808
"with_programming_language",
809809
)
810-
_types= {"avatar":types.ImageAttribute,"topic":types.ListAttribute}
810+
_types= {
811+
"avatar":types.ImageAttribute,
812+
"topic":types.CommaSeparatedListAttribute,
813+
}
811814

812815
defget(self,id:Union[str,int],lazy:bool=False,**kwargs:Any)->Project:
813816
returncast(Project,super().get(id=id,lazy=lazy,**kwargs))

‎gitlab/v4/objects/runners.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class RunnerManager(CRUDMixin, RESTManager):
6868
),
6969
)
7070
_list_filters= ("scope","tag_list")
71-
_types= {"tag_list":types.ListAttribute}
71+
_types= {"tag_list":types.CommaSeparatedListAttribute}
7272

7373
@cli.register_custom_action("RunnerManager",tuple(), ("scope",))
7474
@exc.on_http_error(exc.GitlabListError)
@@ -130,7 +130,7 @@ class GroupRunnerManager(ListMixin, RESTManager):
130130
_from_parent_attrs= {"group_id":"id"}
131131
_create_attrs=RequiredOptional(required=("runner_id",))
132132
_list_filters= ("scope","tag_list")
133-
_types= {"tag_list":types.ListAttribute}
133+
_types= {"tag_list":types.CommaSeparatedListAttribute}
134134

135135

136136
classProjectRunner(ObjectDeleteMixin,RESTObject):
@@ -143,4 +143,4 @@ class ProjectRunnerManager(CreateMixin, DeleteMixin, ListMixin, RESTManager):
143143
_from_parent_attrs= {"project_id":"id"}
144144
_create_attrs=RequiredOptional(required=("runner_id",))
145145
_list_filters= ("scope","tag_list")
146-
_types= {"tag_list":types.ListAttribute}
146+
_types= {"tag_list":types.CommaSeparatedListAttribute}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp