@@ -1886,34 +1886,66 @@ def delete_fork_relation(self):
1886
1886
r = self .gitlab ._raw_delete (url )
1887
1887
raise_error_from_response (r ,GitlabDeleteError )
1888
1888
1889
- def star (self ):
1889
+ def star (self , ** kwargs ):
1890
1890
"""Star a project.
1891
1891
1892
1892
Returns:
1893
1893
Project: the updated Project
1894
1894
1895
1895
Raises:
1896
+ GitlabCreateError: If the action cannot be done
1896
1897
GitlabConnectionError: If the server cannot be reached.
1897
1898
"""
1898
1899
url = "/projects/%s/star" % self .id
1899
- r = self .gitlab ._raw_post (url )
1900
- raise_error_from_response (r ,GitlabGetError , [201 ,304 ])
1900
+ r = self .gitlab ._raw_post (url , ** kwargs )
1901
+ raise_error_from_response (r ,GitlabCreateError , [201 ,304 ])
1901
1902
return Project (self .gitlab ,r .json ())if r .status_code == 201 else self
1902
1903
1903
- def unstar (self ):
1904
+ def unstar (self , ** kwargs ):
1904
1905
"""Unstar a project.
1905
1906
1906
1907
Returns:
1907
1908
Project: the updated Project
1908
1909
1909
1910
Raises:
1911
+ GitlabDeleteError: If the action cannot be done
1910
1912
GitlabConnectionError: If the server cannot be reached.
1911
1913
"""
1912
1914
url = "/projects/%s/star" % self .id
1913
- r = self .gitlab ._raw_delete (url )
1915
+ r = self .gitlab ._raw_delete (url , ** kwargs )
1914
1916
raise_error_from_response (r ,GitlabDeleteError , [200 ,304 ])
1915
1917
return Project (self .gitlab ,r .json ())if r .status_code == 200 else self
1916
1918
1919
+ def archive_ (self ,** kwargs ):
1920
+ """Archive a project.
1921
+
1922
+ Returns:
1923
+ Project: the updated Project
1924
+
1925
+ Raises:
1926
+ GitlabCreateError: If the action cannot be done
1927
+ GitlabConnectionError: If the server cannot be reached.
1928
+ """
1929
+ url = "/projects/%s/archive" % self .id
1930
+ r = self .gitlab ._raw_post (url ,** kwargs )
1931
+ raise_error_from_response (r ,GitlabCreateError ,201 )
1932
+ return Project (self .gitlab ,r .json ())if r .status_code == 201 else self
1933
+
1934
+ def unarchive_ (self ,** kwargs ):
1935
+ """Unarchive a project.
1936
+
1937
+ Returns:
1938
+ Project: the updated Project
1939
+
1940
+ Raises:
1941
+ GitlabDeleteError: If the action cannot be done
1942
+ GitlabConnectionError: If the server cannot be reached.
1943
+ """
1944
+ url = "/projects/%s/unarchive" % self .id
1945
+ r = self .gitlab ._raw_delete (url ,** kwargs )
1946
+ raise_error_from_response (r ,GitlabCreateError ,201 )
1947
+ return Project (self .gitlab ,r .json ())if r .status_code == 201 else self
1948
+
1917
1949
1918
1950
class TeamMember (GitlabObject ):
1919
1951
_url = '/user_teams/%(team_id)s/members'