@@ -908,6 +908,29 @@ class ProjectMilestone(GitlabObject):
908
908
shortPrintAttr = 'title'
909
909
910
910
911
+ class ProjectLabel (GitlabObject ):
912
+ _url = '/projects/%(project_id)s/labels'
913
+ requiredUrlAttrs = ['project_id' ]
914
+ requiredDeleteAttrs = ['name' ]
915
+ requiredCreateAttrs = ['name' , 'color' ]
916
+ # FIXME: new_name is only valid with update
917
+ optionalCreateAttrs = ['new_name' ]
918
+ shortPrintAttr = 'name'
919
+
920
+
921
+ class ProjectFile (GitlabObject ):
922
+ _url = '/projects/%(project_id)s/repository/files'
923
+ canList = False
924
+ requiredUrlAttrs = ['project_id' ]
925
+ requiredGetAttrs = ['file_path' , 'ref' ]
926
+ requiredCreateAttrs = ['file_path' , 'branch_name' , 'content' ,
927
+ 'commit_message' ]
928
+ optionalCreateAttrs = ['encoding' ]
929
+ requiredDeleteAttrs = ['branch_name' , 'commit_message' ]
930
+ getListWhenNoId = False
931
+ shortPrintAttr = 'name'
932
+
933
+
911
934
class ProjectSnippetNote (GitlabObject ):
912
935
_url = '/projects/%(project_id)s/snippets/%(snippet_id)s/notes'
913
936
_constructorTypes = {'author' : 'User' }
@@ -1025,6 +1048,16 @@ def Snippet(self, id=None, **kwargs):
1025
1048
project_id = self .id ,
1026
1049
** kwargs )
1027
1050
1051
+ def Label (self , id = None , ** kwargs ):
1052
+ return self ._getListOrObject (ProjectLabel , id ,
1053
+ project_id = self .id ,
1054
+ ** kwargs )
1055
+
1056
+ def File (self , id = None , ** kwargs ):
1057
+ return self ._getListOrObject (ProjectFile , id ,
1058
+ project_id = self .id ,
1059
+ ** kwargs )
1060
+
1028
1061
def Tag (self , id = None , ** kwargs ):
1029
1062
return self ._getListOrObject (ProjectTag , id ,
1030
1063
project_id = self .id ,
0 commit comments