@@ -56,6 +56,31 @@ public function owned($page = 1, $per_page = self::PER_PAGE, $order_by = self::O
5656 ));
5757 }
5858
59+ /**
60+ * Get a list of projects which are starred by the authenticated user.
61+ *
62+ * @param int $page Page number
63+ * @param int $per_page Number of starred projects per page
64+ * @param null $archived if passed, limit by archived status
65+ * @param null $visibility if passed, limit by visibility public, internal, private
66+ * @param string $order_by Return requests ordered by id, name, path, created_at, updated_at or last_activity_at fields. Default is created_at
67+ * @param string $sort Return requests sorted in asc or desc order. Default is desc
68+ * @param null $search Return list of authorized projects according to a search criteria
69+ * @return mixed
70+ */
71+ public function starred ($ page = 1 , $ per_page = self ::PER_PAGE , $ archived = null , $ visibility = null , $ order_by = self ::ORDER_BY , $ sort = self ::SORT , $ search = null )
72+ {
73+ return $ this ->get ('projects/starred ' , array (
74+ 'page ' => $ page ,
75+ 'per_page ' => $ per_page ,
76+ 'archived ' => $ archived ,
77+ 'visibility ' => $ visibility ,
78+ 'order_by ' => $ order_by ,
79+ 'sort ' => $ sort ,
80+ 'search ' => $ search
81+ ));
82+ }
83+
5984 /**
6085 * @param string $query
6186 * @param int $page
@@ -417,4 +442,20 @@ public function removeService($project_id, $service_name)
417442 {
418443 return $ this ->delete ($ this ->getProjectPath ($ project_id , 'services/ ' .$ this ->encodePath ($ service_name )));
419444 }
445+
446+ /**
447+ * @param $project_id
448+ * @param $sha
449+ * @param $state The state of the status. Can be one of the following: pending, running, success, failed, canceled
450+ * @param array $params name or context (string) = The label to differentiate this status from the status of other systems. Default value is default
451+ * target_url (string) = The target URL to associate with this status
452+ * description (string) = The short description of the status
453+ * @return mixed
454+ */
455+ public function createStatus ($ project_id , $ sha , $ state , array $ params = array ())
456+ {
457+ $ params ['state ' ] = $ state ;
458+ return $ this ->post ($ this ->getProjectPath ($ project_id , 'statuses/ ' .$ this ->encodePath ($ sha )), $ params );
459+ }
460+
420461}
0 commit comments