update_membership: Update membership of an organization or team

Description Usage Arguments Details Value Examples

View source: R/memberships.R

Description

This function can be used to invite a user into an organization or team, or update their role within the organization or team.

Usage

1
update_membership(user, org, team, role, ...)

Arguments

user

(string) The login of the user.

org

(string) The login of the organization.

team

(integer or string, optional) The ID or name of the team.

role

(string, optional) The role to give the user. For an organization this is either "member" or "admin", for a team it is either "member" or "maintainer".

...

Parameters passed to gh_request().

Details

Note: you can only invite or update a user if the authenticate user is an organization "owner" or a team "maintainer".

For more details see the GitHub API documentation:

Value

update_memberships() returns a list of membership properties

Membership Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 

  # Invite a new user into an organization
  update_membership("ChadGoymer2", "HairyCoos")

  # Update a user's role in an organization
  update_membership("ChadGoymer2", "HairyCoos", role = "admin")

  # Invite a new user into a team
  update_membership("ChadGoymer2", "HairyCoos", "HeadCoos")

  # Update a user's role in a team
  update_membership(
    user = "ChadGoymer2",
    org  = "HairyCoos",
    team = "HeadCoos",
    role = "maintainer"
  )


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.