Groups
Provides functionality for querying information about groups, creating new ones, updating memberships, and deleting them.
Prepare:
// @see: https://bitbucket.org/account/user/<username or team>/api
$oauth_params = array(
'client_id' => 'aaa',
'client_secret' => 'bbb'
);
$groups = new \Bitbucket\API\Groups();
$groups->getClient()->addListener(
new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);
Get a list of groups:
$groups->get($account_name);
Get a list of matching groups:
$groups->get($account_name, array(
'group' => 'repo_name/administrators'
));
Create a new group:
$groups->create($account_name, 'testers');
Update a group:
$groups->update($account_name, 'testers', array(
'accountname' => 'gentlero',
'name' => 'Dummy group'
));
Delete a group:
$groups->delete($account_name, 'testers');