Removed drive_v3_native_names from gam.cfg
Some checks failed
Push wiki / pushwiki (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
Ross Scroggs
2025-07-27 21:16:11 -07:00
parent bdce13e97b
commit 0e0877e084
4 changed files with 27 additions and 35 deletions

View File

@@ -1,15 +1,11 @@
!All Google Drive API calls have been converted from v2 to v3, see: https://developers.google.com/drive/v3/web/migration Legacy GAM used Drive API v2, GAM7 uses Drive API v3. See: https://developers.google.com/drive/v3/web/migration
Many of the changes are internal to Gam and have no visible effect. Google has modified/renamed many field names and these will affect scripts that parse the output from `gam print/show drivesettings/drivefileacls/fileinfo/filelist/filerevisions`. Additionally, Google has dropped some fields and their values are no longer available. On input, Gam accepts both the old and new field names. Many of the changes are internal to GAM7 and have no visible effect. Google has modified/renamed many field names and these will affect scripts that parse the output from `gam print/show drivesettings/drivefileacls/fileinfo/filelist/filerevisions`. Additionally, Google has dropped some fields and their values are no longer available. On input, GAM7 accepts both the old and new field names where applicable.
A variable, `drive_v3_native_names` (default value is True), has been added to `gam.cfg` to control the field names on output: when True, the v3 native field names are used; when False, the v3 native field names are mapped to the v2 field names. If you use Legacy GAM and have scripts that process the output from these print commands, you may have to make modifications to your scripts when you upgrade to GAM7.
Run your print/show commands with a version of Legacy GAM and save the output.
If you have scripts that process the output from these print commands, you may have to make modifications to your scripts. Run your print/show commands with GAM7 and compare the output to that saved in the previous run;
Run your print/show commands with a version of Legacy Gam and save the output.
With drive_v3_native_names = False, run your print/show commands with this version of Gam and compare the output to that saved in the previous run;
modify your scripts that process the output as appropriate. modify your scripts that process the output as appropriate.
There is a cost to mapping the v3 field names back to the v2 field names; you can avoid this cost by setting drive_v3_native_names = True,
running your print/show commands, comparing the output and making the appropriate script modifications.
``` ```
print/show drivesettings print/show drivesettings
Dropped fields: Dropped fields:
@@ -30,7 +26,7 @@ Dropped fields:
authKey authKey
Renamed fields (Old->New): Renamed fields (Old->New):
name->displayName name->displayName
withLink->allowFileDiscovery withLink->allowFileDiscovery - value is complemented
print/show fileinfo/filelist print/show fileinfo/filelist
Dropped fields: Dropped fields:
@@ -40,19 +36,20 @@ Dropped fields:
labels(hidden) labels(hidden)
markedViewedByMeDate markedViewedByMeDate
openWithLinks openWithLinks
selfLink ownerNames
parents(isRoot) parents(isRoot)
parents(parentLink) parents(parentLink)
parents(selfLink) parents(selfLink)
permissions(selfLink) permissions(selfLink)
selfLink selfLink
userPermission(selfLink) userPermission
Renamed fields (Old->New): Renamed fields (Old->New):
alternateLink->webViewLink alternateLink->webViewLink
capabilities(canChangeRestrictedDownload)->capabilities(canChangeViewersCanCopyContent) capabilities(canChangeRestrictedDownload)->capabilities(canChangeViewersCanCopyContent)
createdDate->createdTime createdDate->createdTime
expirationDate->expirationTime expirationDate->expirationTime
fileSize->size fileSize->size
lastModifyingUserName->lastModifyingUser(displayName)
lastViewedByMeDate->viewedByMeTime lastViewedByMeDate->viewedByMeTime
modified->modifiedByMe modified->modifiedByMe
modifiedByMeDate->modifiedByMeTime modifiedByMeDate->modifiedByMeTime
@@ -76,18 +73,3 @@ Renamed fields (Old->New):
picture.url->photoLink picture.url->photoLink
pinned->keepForever pinned->keepForever
``` ```
The parents field of a file has undergone the most change. In Drive v2 it was a list of compound items with three sub-fields per item: id, isRoot, parentLink.
In Drive v3 the parents field is a list of simple items, the parent ids. The following examples show how the parents field is output in a CSV file for a file with two parents.
```
Previous versions of Gam:
Owner,title,parents,parents.0.isRoot,parents.0.id,parents.0.parentLink,parents.1.isRoot,parents.1.id,parents.1.parentLink
testuser@domain.com,TestFile,2,True,PPPP1111,https://www.googleapis.com/drive/v2/files/PPPP1111,False,PPPP2222,https://www.googleapis.com/drive/v2/files/PPPP2222
Current version of Gam with drive_v3_name_names = false
Owner,title,parents,parents.0.id,parents.1.id
testuser@domain.com,TestFile,2,PPPP1111,PPPP2222
Current version of Gam with drive_v3_name_names = true
Owner,name,parents
testuser@domain.com,TestFile,PPPP1111 PPPP2222
```

View File

@@ -10,6 +10,13 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
### 7.16.00
Removed `drive_v3_native_names` from `gam.cfg`; GAM now only uses Drive API v3 fields names on output.
If you had `drive_v3_native_names = False` in `gam.cfg` or are updating from Legacy GAM:
* See: https://github.com/GAM-team/GAM/wiki/Drive-REST-API-v3
### 7.15.01 ### 7.15.01
Added `downloadrestrictions.restrictedforreaders` and `downloadrestrictions.restrictedforwriters` Added `downloadrestrictions.restrictedforreaders` and `downloadrestrictions.restrictedforwriters`

View File

@@ -2,6 +2,9 @@
Use these steps if you have used any version of GAM in your domain. They will update your GAM project Use these steps if you have used any version of GAM in your domain. They will update your GAM project
and all necessary authentications. and all necessary authentications.
* See: https://github.com/GAM-team/GAM/wiki/Drive-REST-API-v3
- [Drive API v2 to Drive API v3](Drive-REST-v3)
- [Downloads-Installs](Downloads-Installs) - [Downloads-Installs](Downloads-Installs)
- [Linux and MacOS and Google Cloud Shell](#linux-and-mac-os-and-google-cloud-shell) - [Linux and MacOS and Google Cloud Shell](#linux-and-mac-os-and-google-cloud-shell)
- [Windows](#windows) - [Windows](#windows)
@@ -251,7 +254,7 @@ writes the credentials into the file oauth2.txt.
admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin$ gam version admin@server:/Users/admin$ gam version
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
GAM 7.15.01 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.5 64-bit final Python 3.13.5 64-bit final
MacOS Sequoia 15.5 x86_64 MacOS Sequoia 15.5 x86_64
@@ -989,7 +992,7 @@ writes the credentials into the file oauth2.txt.
C:\>del C:\GAMConfig\oauth2.txt C:\>del C:\GAMConfig\oauth2.txt
C:\>gam version C:\>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAM 7.15.01 - https://github.com/GAM-team/GAM - pythonsource GAM 7.16.00 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.5 64-bit final Python 3.13.5 64-bit final
Windows-10-10.0.17134 AMD64 Windows-10-10.0.17134 AMD64

View File

@@ -4,7 +4,7 @@ k
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAM 7.15.01 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.5 64-bit final Python 3.13.5 64-bit final
MacOS Sequoia 15.5 x86_64 MacOS Sequoia 15.5 x86_64
@@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00
Print the current version of Gam with details and time offset information Print the current version of Gam with details and time offset information
``` ```
gam version timeoffset gam version timeoffset
GAM 7.15.01 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.5 64-bit final Python 3.13.5 64-bit final
MacOS Sequoia 15.5 x86_64 MacOS Sequoia 15.5 x86_64
@@ -28,7 +28,7 @@ Your system time differs from www.googleapis.com by less than 1 second
Print the current version of Gam with extended details and SSL information Print the current version of Gam with extended details and SSL information
``` ```
gam version extended gam version extended
GAM 7.15.01 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.5 64-bit final Python 3.13.5 64-bit final
MacOS Sequoia 15.5 x86_64 MacOS Sequoia 15.5 x86_64
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gam7 Path: /Users/Admin/bin/gam7
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 7.15.01 Latest: 7.16.00
echo $? echo $?
1 1
``` ```
@@ -73,7 +73,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
7.15.01 7.16.00
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@@ -83,7 +83,7 @@ echo $VER
Print the current version of Gam and address of this Wiki Print the current version of Gam and address of this Wiki
``` ```
gam help gam help
GAM 7.15.01 - https://github.com/GAM-team/GAM GAM 7.16.00 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.5 64-bit final Python 3.13.5 64-bit final
MacOS Sequoia 15.5 x86_64 MacOS Sequoia 15.5 x86_64