@@ -965,6 +965,29 @@ class ProjectMilestone(GitlabObject):
965
965
shortPrintAttr = 'title'
966
966
967
967
968
+ class ProjectLabel (GitlabObject ):
969
+ _url = '/projects/%(project_id)s/labels'
970
+ requiredUrlAttrs = ['project_id' ]
971
+ requiredDeleteAttrs = ['name' ]
972
+ requiredCreateAttrs = ['name' , 'color' ]
973
+ # FIXME: new_name is only valid with update
974
+ optionalCreateAttrs = ['new_name' ]
975
+ shortPrintAttr = 'name'
976
+
977
+
978
+ class ProjectFile (GitlabObject ):
979
+ _url = '/projects/%(project_id)s/repository/files'
980
+ canList = False
981
+ requiredUrlAttrs = ['project_id' ]
982
+ requiredGetAttrs = ['file_path' , 'ref' ]
983
+ requiredCreateAttrs = ['file_path' , 'branch_name' , 'content' ,
984
+ 'commit_message' ]
985
+ optionalCreateAttrs = ['encoding' ]
986
+ requiredDeleteAttrs = ['branch_name' , 'commit_message' ]
987
+ getListWhenNoId = False
988
+ shortPrintAttr = 'name'
989
+
990
+
968
991
class ProjectSnippetNote (GitlabObject ):
969
992
_url = '/projects/%(project_id)s/snippets/%(snippet_id)s/notes'
970
993
_constructorTypes = {'author' : 'User' }
@@ -1081,6 +1104,16 @@ def Snippet(self, id=None, **kwargs):
1081
1104
project_id = self .id ,
1082
1105
** kwargs )
1083
1106
1107
+ def Label (self , id = None , ** kwargs ):
1108
+ return self ._getListOrObject (ProjectLabel , id ,
1109
+ project_id = self .id ,
1110
+ ** kwargs )
1111
+
1112
+ def File (self , id = None , ** kwargs ):
1113
+ return self ._getListOrObject (ProjectFile , id ,
1114
+ project_id = self .id ,
1115
+ ** kwargs )
1116
+
1084
1117
def Tag (self , id = None , ** kwargs ):
1085
1118
return self ._getListOrObject (ProjectTag , id ,
1086
1119
project_id = self .id ,
0 commit comments