Last active
October 26, 2020 05:27
-
-
Save shikumiya-hata/0570f904d5d1debb1610b7a38d77de23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 共有ドライブ名から共有ドライブを取得 | |
* @param {string} teamDriveName - 共有ドライブ名 | |
* @return {TeamDrive} - 共有ドライブ | |
*/ | |
function getByName(teamDriveName) { | |
// 共有ドライブのリストから一致する名前を検索(オプション使用) | |
const teamDrives = Drive.Teamdrives.list({q: "name contains '"+teamDriveName+"'", useDomainAdminAccess:true}).items | |
return teamDrives[0] | |
/* | |
// 共有ドライブのリストから一致する名前を検索(オプションなし) | |
const teamDrives = Drive.Teamdrives.list().items | |
for (var i in teamDrives) { | |
var teamDrive = teamDrives[i] | |
if (teamDrive.name === teamDriveName) { | |
return teamDrive | |
} | |
} | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment