为sharedDrive中的用户插入权限

问题描述 投票:0回答:1

我想在特定的共享驱动器(团队驱动器)中添加成员。我尝试插入权限请求,如下所示:

 var listPermisssion = new List<TeamDrivePermissionDetailsData>() { };
                TeamDrivePermissionDetailsData permission = new TeamDrivePermissionDetailsData()
                {
                    Role = role,
                    TeamDrivePermissionType ="member" ,

                };

                listPermisssion.Add(permission);

                Permission tdrivePermission = new Permission();
                tdrivePermission.EmailAddress = who;
                tdrivePermission.TeamDrivePermissionDetails = listPermisssion;
                var requestPermission = service.Permissions.Create(tdrivePermission, sharedDriveId);
                requestPermission.Execute();

我收到此错误:错误:“ Google.Apis.Requests.RequestError

权限角色字段为必填。 [400]

感谢帮助。

c# google-drive-api
1个回答
0
投票

Permissions:create方法需要如role中所述指定typedocumentation。>

  • [member不是type的有效选项-它应该是以下选项之一:

© www.soinside.com 2019 - 2024. All rights reserved.