Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert having allowed values for add_to_collaborators #2905

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions github/Repository.py
Expand Up @@ -253,7 +253,9 @@
from github.DependabotAlert import DependabotAlert
from github.Deployment import Deployment
from github.Download import Download
from github.EnvironmentDeploymentBranchPolicy import EnvironmentDeploymentBranchPolicyParams
from github.EnvironmentDeploymentBranchPolicy import (
EnvironmentDeploymentBranchPolicyParams,
)
jodelasur marked this conversation as resolved.
Show resolved Hide resolved
from github.EnvironmentProtectionRuleReviewer import ReviewerParams
from github.Event import Event
from github.GitBlob import GitBlob
Expand Down Expand Up @@ -1043,11 +1045,11 @@ def add_to_collaborators(self, collaborator: str | NamedUser, permission: Opt[st
"""
:calls: `PUT /repos/{owner}/{repo}/collaborators/{user} <https://docs.github.com/en/rest/collaborators/collaborators#add-a-repository-collaborator>`_
:param collaborator: string or :class:`github.NamedUser.NamedUser`
:param permission: string 'pull', 'push', 'admin', 'maintain', or 'triage'
:param permission: string 'pull', 'push', 'admin', 'maintain', 'triage', or a custom repository role name, if the owning organization has defined any
:rtype: None
"""
assert isinstance(collaborator, github.NamedUser.NamedUser) or isinstance(collaborator, str), collaborator
assert permission in ["pull", "push", "admin", "maintain", "triage", NotSet], permission
assert is_optional(permission, str), permission

if isinstance(collaborator, github.NamedUser.NamedUser):
collaborator = collaborator._identity
Expand Down