We have detected an error in your notification set-up
(Event-ID dab39dc24f564ec7bd4628d1305fd03c).
Currently, we cannot inform you about inspection progress.
Please check that the user
557058:bca11929-8c2d-43f2-8a82-c5416880d395 still has access to your repository or
update the API account.
| 1 | <?php |
||
| 22 | class Groups extends Api |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * Get a list of groups. |
||
| 26 | * |
||
| 27 | * If `$filters` is not omitted, will return a list of matching groups. |
||
| 28 | * |
||
| 29 | * <example> |
||
| 30 | * $filters = array( |
||
| 31 | * 'group' => array('account_name/group_slug', 'other_account/group_slug') |
||
| 32 | * ); |
||
| 33 | * </example> |
||
| 34 | * |
||
| 35 | * @access public |
||
| 36 | * @param string $account The team or individual account owning the repository. |
||
| 37 | * @param array $filters |
||
| 38 | * @return MessageInterface |
||
| 39 | */ |
||
| 40 | 2 | public function get($account, array $filters = array()) |
|
| 41 | { |
||
| 42 | // Default: fetch groups list |
||
| 43 | 2 | $endpoint = sprintf('groups/%s/', $account); |
|
| 44 | |||
| 45 | 2 | if (!empty($filters)) { |
|
| 46 | 1 | $endpoint = 'groups'; |
|
| 47 | |||
| 48 | 1 | if (isset($filters['group']) && is_array($filters['group'])) { |
|
| 49 | 1 | $filters['group'] = implode('&group=', $filters['group']); |
|
| 50 | 1 | } |
|
| 51 | 1 | } |
|
| 52 | |||
| 53 | 2 | return $this->requestGet($endpoint, $filters); |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Create a new group |
||
| 58 | * |
||
| 59 | * @access public |
||
| 60 | * @param string $account The team or individual account owning the repository. |
||
| 61 | * @param string $name The name of the group. |
||
| 62 | * @return MessageInterface |
||
| 63 | */ |
||
| 64 | 1 | public function create($account, $name) |
|
| 71 | |||
| 72 | /** |
||
| 73 | * Update a group |
||
| 74 | * |
||
| 75 | * @access public |
||
| 76 | * @param string $account The team or individual account owning the repository. |
||
| 77 | * @param string $name The name of the group. |
||
| 78 | * @param array $params |
||
| 79 | * @return MessageInterface |
||
| 80 | */ |
||
| 81 | 1 | public function update($account, $name, array $params) |
|
| 88 | |||
| 89 | /** |
||
| 90 | * Delete a group |
||
| 91 | * |
||
| 92 | * @access public |
||
| 93 | * @param string $account The team or individual account owning the repository. |
||
| 94 | * @param string $name The name of the group. |
||
| 95 | * @return MessageInterface |
||
| 96 | */ |
||
| 97 | 1 | public function delete($account, $name) |
|
| 103 | |||
| 104 | /** |
||
| 105 | * Get members |
||
| 106 | * |
||
| 107 | * @access public |
||
| 108 | * @return Groups\Members |
||
| 109 | * |
||
| 110 | * @throws \InvalidArgumentException |
||
| 111 | * @codeCoverageIgnore |
||
| 112 | */ |
||
| 113 | public function members() |
||
| 117 | } |
||
| 118 |