code: func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) {
  	opts := &struct {
  		Permissions string `json:"permissions"`
  	}{Permissions: permissions}
  	u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID)
  	req, err := s.client.NewRequest("PATCH", u, opts)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	invite := &RepositoryInvitation{}
  	resp, err := s.client.Do(ctx, req, invite)
  	if err != nil {
  		return nil, resp, err
  	}
  
  	return invite, resp, nil
  }
docs: // UpdateInvitation updates the permissions associated with a repository
  // invitation.
  //
  // permissions represents the permissions that the associated user will have
  // on the repository. Possible values are: "read", "write", "admin".
  //
  // GitHub API docs: https://developer.github.com/v3/repos/invitations/#update-a-repository-invitation