Package com.jcabi.github
Interface Collaborators
@Immutable
public interface Collaborators
GitHub repository collaborators.
- Since:
- 0.8
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumPermission levels a user can be granted in an organization repository. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd user as a collaborator.voidaddWithPermission(String user, Collaborators.Permission permission) Add user with permissions.booleanisCollaborator(String user) Check if a user is collaborator.iterate()Iterates over repo collaborators.permission(String user) Get user permission in this repo.voidRemove user as a collaborator.repo()Owner of them.
-
Method Details
-
repo
Repo repo()Owner of them.- Returns:
- Repo
-
isCollaborator
Check if a user is collaborator.- Parameters:
user- User- Returns:
- True is a user is a collaborator, otherwise returns false
- Throws:
IOException- If there is any I/O problem- See Also:
-
add
Add user as a collaborator.- Parameters:
user- User- Throws:
IOException- If there is any I/O problem- See Also:
-
addWithPermission
Add user with permissions. Only works on an organization repository- Parameters:
user- User to addpermission- Permission level to grant- Throws:
IOException- if there is an I/O problem- See Also:
-
- invalid input: '<a href=https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator">Add user as a collaborator</a>'
-
permission
Get user permission in this repo.- Parameters:
user- User to check- Returns:
- Permission level granted, incl. "admin", "write", "read", or "none"
- Throws:
IOException- if there is an I/O problem- See Also:
-
- invalid input: '<a href=https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user">Get repository permissions for a user</a>'
-
remove
Remove user as a collaborator.- Parameters:
user- User- Throws:
IOException- If there is any I/O problem- See Also:
-
iterate
Iterates over repo collaborators.- Returns:
- Iterator on repo collaborators.
-