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

setOrgUnitId replies success but fails to change anything #2506

Open
jwpegram opened this issue Sep 28, 2023 · 0 comments
Open

setOrgUnitId replies success but fails to change anything #2506

jwpegram opened this issue Sep 28, 2023 · 0 comments
Labels
api: drive Issues related to the Drive API API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@jwpegram
Copy link

I'm trying to change the orgUnitId of a shared drive. Everything I can find suggests the below code should work but it doesn't. The drive api doesn't throw any errors, the update call returns a 200 but the org is never changed. Any thoughts?

// Create a Google Drive service instance
$service = new Google_Service_Drive($client);

// Specify the shared drive ID you want to modify
$driveId = 'YOUR_SHARED_DRIVE_ID';

// Specify the new orgUnitId
$newOrgUnitId = 'new_org_unit_id';

// Build the request to update the shared drive's orgUnitId
$updateDrive = new Google_Service_Drive_Drive();
$updateDrive->setOrgUnitId($newOrgUnitId);

$optParams = array(
     'useDomainAdminAccess' => true
);

// Update the shared drive with the new orgUnitId
try {
    $drive = $service->drives->update($driveId, $updateDrive);
    echo "Shared drive updated with new orgUnitId: {$drive->getOrgUnitId()}";
} catch (Google_Service_Exception $e) {
    echo "Error updating shared drive: " . $e->getMessage();
}
@yash30201 yash30201 added priority: p2 Moderately-important priority. Fix may not be included in next release. api: drive Issues related to the Drive API API. labels Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: drive Issues related to the Drive API API. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

No branches or pull requests

2 participants