Multiple updates/fixes

This commit is contained in:
Ross Scroggs
2023-11-25 09:18:06 -08:00
parent 0562639715
commit 46d4e78b79
9 changed files with 248 additions and 32 deletions

View File

@@ -10,6 +10,24 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
### 6.65.17
Added the option `mappermissionsdomain <DomainName1> <DomainName2>` to `gam <UserTypeEntity> create drivefileacl <DriveFileEntity>`
that maps `<DomainName1>` to `<DomainName2>` in the `user <UserItem>)|(group <GroupItem>)|(domain <DomainName>)` options;
`<UserItem>` and `<GroupItem>` must specify email addresses for the mapping to succeed.
The option can be specified multiple times to provide different mappings. This option will be most useful
when reading a CSV file containing ACLs referencing `<DomainName1>` and you want a new ACL with the same options but in `<DomainName2>`.
### 6.65.16
Fixed bug in `gam <UserTypeEntity> print filecounts` where `Item Cap` showed an incorrect value.
Added option `addorigfieldstosubject` to `gam <UserTypeEntity> forward messages|threads` that causes GAM
to append the original `from`, `to` and `date` fields to the message subject.
```
Fwd: Ross to TestUser (Original From: Ross Scroggs <ross.scroggs@gmail.com> To: testuser@domain.com Date: Thu, 23 Nov 2023 07:01:59 -0800)
```
### 6.65.15 ### 6.65.15
Added additional options to `gam <UserTypeEntity> print|show youtubechannels`. Added additional options to `gam <UserTypeEntity> print|show youtubechannels`.

View File

@@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version admin@server:/Users/admin/bin/gamadv-xtd3$ ./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
GAMADV-XTD3 6.65.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.17 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64 MacOS High Sierra 10.13.6 x86_64
@@ -1002,7 +1002,7 @@ writes the credentials into the file oauth2.txt.
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version C:\GAMADV-XTD3>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
GAMADV-XTD3 6.65.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.17 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
Windows-10-10.0.17134 AMD64 Windows-10-10.0.17134 AMD64

View File

@@ -17,6 +17,12 @@
- [Empty calendar trash](#empty-calendar-trash) - [Empty calendar trash](#empty-calendar-trash)
- [Display calendar events](#display-calendar-events) - [Display calendar events](#display-calendar-events)
- [Update calendar event attendees](#update-calendar-event-attendees) - [Update calendar event attendees](#update-calendar-event-attendees)
- [Focus time events](#focus-time-events)
- [Manage focus time events](#manage-focus-time-events)
- [Display focus time events](#display-focus-time-events)
- [Out of officeevents](#out-of-office-events)
- [Manage Out of office events](#manage-out-of-office-events)
- [Display Out of officeevents](#display-out-of-office-events)
- [Working location events](#working-location-events) - [Working location events](#working-location-events)
- [Manage working location events](#manage-working-location-events) - [Manage working location events](#manage-working-location-events)
- [Display working location events](#display-working-location-events) - [Display working location events](#display-working-location-events)
@@ -166,12 +172,21 @@
creator.id| creator.id|
creator.self creator.self
<EventFocusTimePropertiesSubfieldName> ::=
focustimeproperties.chatstatus|
focustimeproperties.declinemode|
focustimeproperties.declinemessage
<EventOrganizerSubfieldName> ::= <EventOrganizerSubfieldName> ::=
organizer.displayname| organizer.displayname|
organizer.email| organizer.email|
organizer.id| organizer.id|
organizer.self organizer.self
<EventOutOfOfficePropertiesSubfieldName> ::=
outofoffice.declinemode|
outofoffice.declinemessage
<EventWorkingLocationPropertiesSubfieldName> ::= <EventWorkingLocationPropertiesSubfieldName> ::=
workinglocationproperties.homeoffice| workinglocationproperties.homeoffice|
workinglocationproperties.customlocation| workinglocationproperties.customlocation|
@@ -195,6 +210,7 @@
endtimeunspecified| endtimeunspecified|
extendedproperties| extendedproperties|
eventtype| eventtype|
<EventFocusTimePropertiesSubfieldName>
gadget| gadget|
guestscaninviteothers| guestscaninviteothers|
guestscanmodify| guestscanmodify|
@@ -208,6 +224,7 @@
organizer| organizer|
<EventOrganizerSubfieldName>| <EventOrganizerSubfieldName>|
originalstart|originalstarttime| originalstart|originalstarttime|
<EventOutOfOfficePropertiesSubfieldName>
privatecopy| privatecopy|
recurrence| recurrence|
recurringeventid| recurringeventid|
@@ -228,9 +245,17 @@
<AttendeeStatus> ::= accepted|declined|needsaction|tentative <AttendeeStatus> ::= accepted|declined|needsaction|tentative
``` ```
``` ```
<EventType> ::=
default|
focustime|
outofoffice|
workinglocation
<EventTypeList> ::= "<EventType>(,<EventType>)*"
<EventSelectProperty> ::= <EventSelectProperty> ::=
(after|starttime|timemin <Time>)| (after|starttime|timemin <Time>)|
(before|endtime|timemax <Time>)| (before|endtime|timemax <Time>)|
(eventtypes <EventTypeList>)|
(query <QueryCalendar>)| (query <QueryCalendar>)|
(privateextendedproperty <String>)| (privateextendedproperty <String>)|
(sharedextendedproperty <String>)| (sharedextendedproperty <String>)|
@@ -285,6 +310,7 @@
(colorindex|colorid <EventColorIndex>)| (colorindex|colorid <EventColorIndex>)|
(description <String>)| (description <String>)|
(end (allday <Date>)|<Time>)| (end (allday <Date>)|<Time>)|
(focustime [declinemode none|all|new] [declinemessage <String>] [chatstatus available|donotdisturb])|
(guestscaninviteothers <Boolean>)| (guestscaninviteothers <Boolean>)|
guestscantinviteothers| guestscantinviteothers|
(guestscanmodify <Boolean>)| (guestscanmodify <Boolean>)|
@@ -298,6 +324,7 @@
(noreminders|(reminder email|popup <Number>))| (noreminders|(reminder email|popup <Number>))|
(optionalattendee <EmailAddress>)| (optionalattendee <EmailAddress>)|
(originalstart|originalstarttime (allday <Date>)|<Time>)| (originalstart|originalstarttime (allday <Date>)|<Time>)|
(outofoffice [declinemode none|all|new] [declinemessage <String>])|
(privateproperty <PropertyKey> <PropertyValue>)| (privateproperty <PropertyKey> <PropertyValue>)|
(recurrence <RRULE, EXRULE, RDATE and EXDATE line>)| (recurrence <RRULE, EXRULE, RDATE and EXDATE line>)|
(reminder <Number> email|popup))| (reminder <Number> email|popup))|
@@ -362,10 +389,12 @@ This is dense reading; a simpler approach is to define a test event in Google Ca
the recurrence rule that you want, then use `gam calendar <EmailAddress> info events eventid <EventId>` to get the recurrence rule and use it in subsequent commands. the recurrence rule that you want, then use `gam calendar <EmailAddress> info events eventid <EventId>` to get the recurrence rule and use it in subsequent commands.
``` ```
RRULE:FREQ=DAILY RRULE:FREQ=DAILY - Daily
RRULE:FREQ=DAILY;COUNT=30 RRULE:FREQ=DAILY;COUNT=30 - Daily for 30 days
RRULE:FREQ=WEEKLY;BYDAY=WE RRULE:FREQ=WEEKLY - Weekly on the same day of the week as the starting day; e.g., every Wednesday
RRULE:FREQ=WEEKLY;WKST=SU;COUNT=13;BYDAY=WE RRULE:FREQ=WEEKLY;COUNT=13 - Weekly on the same day of the week as the starting day; e.g., every Wednesday, for 13 weeks
RRULE:FREQ=MONTHLY - Monthly on the same day of the month as the starting day; e.g., every 15th of the month
RRULE:FREQ=MONTHLY;BYDAY=4TH - Monthly on the fourth instance of the starting day; e.g., every 4th Thursday
``` ```
## Event colors ## Event colors
@@ -692,6 +721,103 @@ the second adds the primary email.
The attendee changes are displayed but not processed unless `doit` is specified. The attendee changes are displayed but not processed unless `doit` is specified.
## Focus time events
## Manage focus time events
You can create and delete focus time events; they can not be updated.
To update a working location event, delete the working location event and recreate it.
```
gam <UserTypeEntity> create focustime
[chatstatus available|donotdisturb]|
[declinemode none|all|new] [declinemessage <String>]|
(timerange <Time> <Time>)+
gam <UserTypeEntity> delete focustime
(timerange <Time> <Time>)+
```
focus time events span a time range:
* `timerange <Time> <Time>` - A time range, may span multiple days
## Display focus time events
```
gam <UserTypeEntity> show focustime
(timerange <Time> <Time>)+
[showdayofweek]
[formatjson]
```
`showdayofweek` displays `dayOfWeek` when event start and end times are displayed.
By default, Gam displays the information as an indented list of keys and values.
* `formatjson` - Display the fields in JSON format.
```
gam <UserTypeEntity> print focustime
(timerange <Time> <Time>)+
[showdayofweek]
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
```
`showdayofweek` displays columns `start.dayOfWeek` and `end.dayOfWeek` when event start and end times are displayed.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
* `formatjson` - Display the fields in JSON format.
By default, Gam displays event details, use `countsonly` to display only the number of events. `formatjson` does not apply in this case.
By default, when writing CSV files, Gam uses a quote character of double quote `"`. The quote character is used to enclose columns that contain
the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.
When using the `formatjson` option, double quotes are used extensively in the data resulting in hard to read/process output.
The `quotechar <Character>` option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.
`quotechar` defaults to `gam.cfg/csv_output_quote_char`. When uploading CSV files to Google, double quote `"` should be used.
## Out of office events
## Manage out of office events
You can create and delete out of office events; they can not be updated.
To update a working location event, delete the working location event and recreate it.
```
gam <UserTypeEntity> create outofoffice
[declinemode none|all|new] [declinemessage <String>]|
(timerange <Time> <Time>)+
gam <UserTypeEntity> delete outofoffice
(timerange <Time> <Time>)+
```
out of office events span a time range:
* `timerange <Time> <Time>` - A time range, may span multiple days
## Display out of office events
```
gam <UserTypeEntity> show outofoffice
(timerange <Time> <Time>)+
[showdayofweek]
[formatjson]
```
`showdayofweek` displays `dayOfWeek` when event start and end times are displayed.
By default, Gam displays the information as an indented list of keys and values.
* `formatjson` - Display the fields in JSON format.
```
gam <UserTypeEntity> print outofoffice
(timerange <Time> <Time>)+
[showdayofweek]
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
```
`showdayofweek` displays columns `start.dayOfWeek` and `end.dayOfWeek` when event start and end times are displayed.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
* `formatjson` - Display the fields in JSON format.
By default, Gam displays event details, use `countsonly` to display only the number of events. `formatjson` does not apply in this case.
By default, when writing CSV files, Gam uses a quote character of double quote `"`. The quote character is used to enclose columns that contain
the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.
When using the `formatjson` option, double quotes are used extensively in the data resulting in hard to read/process output.
The `quotechar <Character>` option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.
`quotechar` defaults to `gam.cfg/csv_output_quote_char`. When uploading CSV files to Google, double quote `"` should be used.
## Working location events ## Working location events
## Manage working location events ## Manage working location events

View File

@@ -129,11 +129,18 @@ specify `basicpermissions` and additional permission fields, e.g., `permissions.
gam <UserTypeEntity> create|add drivefileacl <DriveFileEntity> gam <UserTypeEntity> create|add drivefileacl <DriveFileEntity>
anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>) (role <DriveFileACLRole>) anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>) (role <DriveFileACLRole>)
[withlink|(allowfilediscovery|discoverable [<Boolean>])] [expiration <Time>] [withlink|(allowfilediscovery|discoverable [<Boolean>])] [expiration <Time>]
(mappermissionsdomain <DomainName> <DomainName>)*
[movetonewownersroot [<Boolean>]] [movetonewownersroot [<Boolean>]]
[sendemail] [emailmessage <String>] [sendemail] [emailmessage <String>]
[updatesheetprotectedranges [<Boolean>]] [updatesheetprotectedranges [<Boolean>]]
[showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])] [showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])]
``` ```
The option `mappermissionsdomain <DomainName1> <DomainName2>` maps `<DomainName1>` to `<DomainName2>` in the
`user <UserItem>)|(group <GroupItem>)|(domain <DomainName>)` options;
`<UserItem>` and `<GroupItem>` must specify email addresses for the mapping to succeed.
The option can be specified multiple times to provide different mappings. This option will be most useful
when reading a CSV file containing ACLs referencing `<DomainName1>` and you want a new ACL with the same options but in `<DomainName2>`.
From the Google Drive API documentation. From the Google Drive API documentation.
* `movetonewownersroot` - This parameter only takes effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. * `movetonewownersroot` - This parameter only takes effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item.
* `false` - Parents are not changed. The file is an orphan for the new owner. This is the default. * `false` - Parents are not changed. The file is an orphan for the new owner. This is the default.

View File

@@ -372,17 +372,22 @@ See below for message selection.
gam <UserTypeEntity> forward message|messages recipient|to <RecipientEntity> gam <UserTypeEntity> forward message|messages recipient|to <RecipientEntity>
(((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
[quick|notquick] [doit] [max_to_forward <Number>])|(ids <MessageIDEntity>) [quick|notquick] [doit] [max_to_forward <Number>])|(ids <MessageIDEntity>)
[subject <String>] [subject <String>] [addorigfieldstosubject]
gam <UserTypeEntity> forward thread|threads recipient|to <RecipientEntity> gam <UserTypeEntity> forward thread|threads recipient|to <RecipientEntity>
(((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
[quick|notquick] [doit] [max_to_forward <Number>])|(ids <ThreadIDEntity>) [quick|notquick] [doit] [max_to_forward <Number>])|(ids <ThreadIDEntity>)
[subject <String>] [subject <String>] [addorigfieldstosubject]
``` ```
By default, the message subject has `Fwd: ` prepended; use `subject <String>` to specify a new subject. By default, the message subject has `Fwd: ` prepended; use `subject <String>` to specify a new subject.
All `Cc` addresses are removed from the forwarded message. All `Cc` addresses are removed from the forwarded message.
If `addorigfieldstosubject` is specified, GAM appends the original `from`, `to` and `date` fields to the message subject.
```
Fwd: Ross to TestUser (Original From: Ross Scroggs <ross.scroggs@gmail.com> To: testuser@domain.com Date: Thu, 23 Nov 2023 07:01:59 -0800)
```
See below for message selection. See below for message selection.
## Manage messages/threads ## Manage messages/threads

View File

@@ -4,7 +4,7 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAMADV-XTD3 6.65.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.17 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 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
GAMADV-XTD3 6.65.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.17 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 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
GAMADV-XTD3 6.65.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.17 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3 Path: /Users/Admin/bin/gamadv-xtd3
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 6.65.15 Latest: 6.65.17
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
6.65.15 6.65.17
``` ```
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 6.65.15 - https://github.com/taers232c/GAMADV-XTD3 GAM 6.65.17 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64

View File

@@ -4589,6 +4589,7 @@ In these commands, the Google administrator named in oauth2.txt is used.
gam create|add drivefileacl <SharedDriveEntityAdmin> gam create|add drivefileacl <SharedDriveEntityAdmin>
anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>) anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>)
(role <DriveFileACLRole>) [withlink|(allowfilediscovery|discoverable [<Boolean>])] (role <DriveFileACLRole>) [withlink|(allowfilediscovery|discoverable [<Boolean>])]
(mappermissionsdomain <DomainName> <DomainName>)*
[expiration <Time>] [sendemail] [emailmessage <String>] [expiration <Time>] [sendemail] [emailmessage <String>]
[showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])] [showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])]
gam update drivefileacl <SharedDriveEntityAdmin> <DriveFilePermissionIDorEmail> gam update drivefileacl <SharedDriveEntityAdmin> <DriveFilePermissionIDorEmail>
@@ -4626,6 +4627,7 @@ In these commands, you specify an administrator and then indicate that you want
gam <UserTypeEntity> create|add drivefileacl <SharedDriveEntityAdmin> gam <UserTypeEntity> create|add drivefileacl <SharedDriveEntityAdmin>
anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>) anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>)
(role <DriveFileACLRole>) [withlink|(allowfilediscovery|discoverable [<Boolean>])] (role <DriveFileACLRole>) [withlink|(allowfilediscovery|discoverable [<Boolean>])]
(mappermissionsdomain <DomainName> <DomainName>)*
[movetonewownersroot [<Boolean>]] [movetonewownersroot [<Boolean>]]
[expiration <Time>] [sendemail] [emailmessage <String>] [expiration <Time>] [sendemail] [emailmessage <String>]
[showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])] [showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])]
@@ -6934,11 +6936,11 @@ gam <UserTypeEntity> export thread|threads
gam <UserTypeEntity> forward message|messages recipient|to <RecipientEntity> gam <UserTypeEntity> forward message|messages recipient|to <RecipientEntity>
(((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
[quick|notquick] [doit] [max_to_forward <Number>])|(ids <MessageIDEntity>) [quick|notquick] [doit] [max_to_forward <Number>])|(ids <MessageIDEntity>)
[subject <String>] [altcharset <String>] [subject <String>] [addorigfieldstosubject [<Boolean>]] [altcharset <String>]
gam <UserTypeEntity> forward thread|thtreads recipient|to <RecipientEntity> gam <UserTypeEntity> forward thread|thtreads recipient|to <RecipientEntity>
(((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
quick|notquick] [doit] [max_to_forward <Number>])|(ids <ThreadIDEntity>) quick|notquick] [doit] [max_to_forward <Number>])|(ids <ThreadIDEntity>)
[subject <String>] [altcharset <String>] [subject <String>] [addorigfieldstosubject [<Boolean>]] [altcharset <String>]
gam <UserTypeEntity> show messages|threads gam <UserTypeEntity> show messages|threads
(((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])* (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])*

View File

@@ -2,6 +2,24 @@
Merged GAM-Team version Merged GAM-Team version
6.65.17
Added the option `mappermissionsdomain <DomainName1> <DomainName2>` to `gam <UserTypeEntity> create drivefileacl <DriveFileEntity>`
that maps `<DomainName1>` to `<DomainName2>` in the `user <UserItem>)|(group <GroupItem>)|(domain <DomainName>)` options;
`<UserItem>` and `<GroupItem>` must specify email addresses for the mapping to succeed.
The option can be specified multiple times to provide different mappings. This option will be most useful
when reading a CSV file containing ACLs referencing `<DomainName1>` and you want a new ACL with the same options but in `<DomainName2>`.
6.65.16
Fixed bug in `gam <UserTypeEntity> print filecounts` where `Item Cap` showed an incorrect value.
Added option `addorigfieldstosubject` to `gam <UserTypeEntity> forward messages|threads` that causes GAM
to append the original `from`, `to` and `date` fields to the message subject.
```
Fwd: Ross to TestUser (Original From: Ross Scroggs <ross.scroggs@gmail.com> To: testuser@domain.com Date: Thu, 23 Nov 2023 07:01:59 -0800)
```
6.65.15 6.65.15
Added additional options to `gam <UserTypeEntity> print|show youtubechannels`. Added additional options to `gam <UserTypeEntity> print|show youtubechannels`.

View File

@@ -1082,7 +1082,7 @@ def getLabelColor(colorType):
invalidArgumentExit('|'.join(colorType)) invalidArgumentExit('|'.join(colorType))
missingArgumentExit(Cmd.OB_LABEL_COLOR_HEX) missingArgumentExit(Cmd.OB_LABEL_COLOR_HEX)
# Language codes used in Drive Labels # Language codes used in Drive Labels/Youtube
BCP47_LANGUAGE_CODES_MAP = { BCP47_LANGUAGE_CODES_MAP = {
'ar-sa': 'ar-SA', 'cs-cz': 'cs-CZ', 'da-dk': 'da-DK', 'de-de': 'de-DE', #Arabic Saudi Arabia, Czech Czech Republic, Danish Denmark, German Germany 'ar-sa': 'ar-SA', 'cs-cz': 'cs-CZ', 'da-dk': 'da-DK', 'de-de': 'de-DE', #Arabic Saudi Arabia, Czech Czech Republic, Danish Denmark, German Germany
'el-gr': 'el-GR', 'en-au': 'en-AU', 'en-gb': 'en-GB', 'en-ie': 'en-IE', #Modern Greek Greece, English Australia, English United Kingdom, English Ireland 'el-gr': 'el-GR', 'en-au': 'en-AU', 'en-gb': 'en-GB', 'en-ie': 'en-IE', #Modern Greek Greece, English Australia, English United Kingdom, English Ireland
@@ -35639,6 +35639,14 @@ def _getCalendarEventAttribute(myarg, body, parameters, function):
body['originalStart'] = getEventTime() body['originalStart'] = getEventTime()
elif myarg in {'end', 'endtime'}: elif myarg in {'end', 'endtime'}:
body['end'] = getEventTime() body['end'] = getEventTime()
elif myarg == 'allday':
body['start'] = body['end'] = {'date': getYYYYMMDD()}
elif myarg == 'range':
body['start'] = {'date': getYYYYMMDD()}
body['end'] = {'date': getYYYYMMDD()}
elif myarg == 'timerange':
body['start'] = {'dateTime': getTimeOrDeltaFromNow()}
body['end'] = {'dateTime': getTimeOrDeltaFromNow()}
elif myarg == 'attachment': elif myarg == 'attachment':
body.setdefault('attachments', []) body.setdefault('attachments', [])
body['attachments'].append({'title': getString(Cmd.OB_STRING), 'fileUrl': getString(Cmd.OB_URL)}) body['attachments'].append({'title': getString(Cmd.OB_STRING), 'fileUrl': getString(Cmd.OB_URL)})
@@ -35750,8 +35758,6 @@ def _getCalendarEventAttribute(myarg, body, parameters, function):
body['extendedProperties'].setdefault('shared', {}) body['extendedProperties'].setdefault('shared', {})
key = getString(Cmd.OB_PROPERTY_KEY) key = getString(Cmd.OB_PROPERTY_KEY)
body['extendedProperties']['shared'][key] = getString(Cmd.OB_PROPERTY_VALUE, minLen=0) body['extendedProperties']['shared'][key] = getString(Cmd.OB_PROPERTY_VALUE, minLen=0)
elif myarg == 'workinglocation':
getWorkingLocationProperties(body)
elif function == 'update' and myarg == 'clearprivateproperty': elif function == 'update' and myarg == 'clearprivateproperty':
body.setdefault('extendedProperties', {}) body.setdefault('extendedProperties', {})
body['extendedProperties'].setdefault('private', {}) body['extendedProperties'].setdefault('private', {})
@@ -36504,6 +36510,7 @@ EVENT_FIELDS_CHOICE_MAP = {
'endtime': 'end', 'endtime': 'end',
'endtimeunspecified': 'endTimeUnspecified', 'endtimeunspecified': 'endTimeUnspecified',
'extendedproperties': 'extendedProperties', 'extendedproperties': 'extendedProperties',
'focustimeproperties': 'focusTimeProperties',
'gadget': 'gadget', 'gadget': 'gadget',
'guestscaninviteothers': 'guestsCanInviteOthers', 'guestscaninviteothers': 'guestsCanInviteOthers',
'guestscanmodify': 'guestsCanModify', 'guestscanmodify': 'guestsCanModify',
@@ -36519,6 +36526,7 @@ EVENT_FIELDS_CHOICE_MAP = {
'organiser': 'organizer', 'organiser': 'organizer',
'originalstart': 'originalStartTime', 'originalstart': 'originalStartTime',
'originalstarttime': 'originalStartTime', 'originalstarttime': 'originalStartTime',
'outofofficeproperties': 'outOfOfficeProperties',
'privatecopy': 'privateCopy', 'privatecopy': 'privateCopy',
'recurrence': 'recurrence', 'recurrence': 'recurrence',
'recurringeventid': 'recurringEventId', 'recurringeventid': 'recurringEventId',
@@ -36573,6 +36581,12 @@ EVENT_CREATOR_SUBFIELDS_CHOICE_MAP = {
'self': 'self', 'self': 'self',
} }
EVENT_FOCUSTIME_SUBFIELDS_CHOICE_MAP = {
'autodeclinemode': 'autoDeclineMode',
'chatstatus': 'chatStatus',
'declinemessage': 'declineMessage',
}
EVENT_ORGANIZER_SUBFIELDS_CHOICE_MAP = { EVENT_ORGANIZER_SUBFIELDS_CHOICE_MAP = {
'displayname': 'displayName', 'displayname': 'displayName',
'email': 'email', 'email': 'email',
@@ -36580,6 +36594,11 @@ EVENT_ORGANIZER_SUBFIELDS_CHOICE_MAP = {
'self': 'self', 'self': 'self',
} }
EVENT_OUTOFOFFICE_SUBFIELDS_CHOICE_MAP = {
'autodeclinemode': 'autoDeclineMode',
'declinemessage': 'declineMessage',
}
EVENT_WORKINGLOCATION_SUBFIELDS_CHOICE_MAP = { EVENT_WORKINGLOCATION_SUBFIELDS_CHOICE_MAP = {
'homeoffice': 'homeOffice', 'homeoffice': 'homeOffice',
'customlocation': 'customLocation', 'customlocation': 'customLocation',
@@ -36591,8 +36610,10 @@ EVENT_SUBFIELDS_CHOICE_MAP = {
'attendees': EVENT_ATTENDEES_SUBFIELDS_CHOICE_MAP, 'attendees': EVENT_ATTENDEES_SUBFIELDS_CHOICE_MAP,
'conferencedata': EVENT_CONFERENCEDATA_SUBFIELDS_CHOICE_MAP, 'conferencedata': EVENT_CONFERENCEDATA_SUBFIELDS_CHOICE_MAP,
'creator': EVENT_CREATOR_SUBFIELDS_CHOICE_MAP, 'creator': EVENT_CREATOR_SUBFIELDS_CHOICE_MAP,
'focustimeproperties': EVENT_FOCUSTIME_SUBFIELDS_CHOICE_MAP,
'organizer': EVENT_ORGANIZER_SUBFIELDS_CHOICE_MAP, 'organizer': EVENT_ORGANIZER_SUBFIELDS_CHOICE_MAP,
'organiser': EVENT_ORGANIZER_SUBFIELDS_CHOICE_MAP, 'organiser': EVENT_ORGANIZER_SUBFIELDS_CHOICE_MAP,
'outofofficeproperties': EVENT_OUTOFOFFICE_SUBFIELDS_CHOICE_MAP,
'workinglocationproperties': EVENT_WORKINGLOCATION_SUBFIELDS_CHOICE_MAP, 'workinglocationproperties': EVENT_WORKINGLOCATION_SUBFIELDS_CHOICE_MAP,
} }
@@ -53013,7 +53034,7 @@ def printShowFileCounts(users):
Ind.Decrement() Ind.Decrement()
else: else:
if sharedDriveId: if sharedDriveId:
row = {'User': user, 'id': sharedDriveId, 'name': sharedDriveName, 'Total': countTotal, 'Item cap': f"{sizeTotal/SHARED_DRIVE_MAX_FILES_FOLDERS:.2%}"} row = {'User': user, 'id': sharedDriveId, 'name': sharedDriveName, 'Total': countTotal, 'Item cap': f"{countTotal/SHARED_DRIVE_MAX_FILES_FOLDERS:.2%}"}
else: else:
row = {'User': user, 'Total': countTotal} row = {'User': user, 'Total': countTotal}
if showSize: if showSize:
@@ -59020,6 +59041,7 @@ def _checkFileIdEntityDomainAccess(fileIdEntity, useDomainAdminAccess):
# gam [<UserTypeEntity>] create drivefileacl <DriveFileEntity> [adminaccess|asadmin] # gam [<UserTypeEntity>] create drivefileacl <DriveFileEntity> [adminaccess|asadmin]
# anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>) (role <DriveFileACLRole>)] # anyone|(user <UserItem>)|(group <GroupItem>)|(domain <DomainName>) (role <DriveFileACLRole>)]
# [withlink|(allowfilediscovery|discoverable [<Boolean>])] [expiration <Time>] # [withlink|(allowfilediscovery|discoverable [<Boolean>])] [expiration <Time>]
# (mappermissionsdomain <DomainName> <DomainName>)*
# [moveToNewOwnersRoot [<Boolean>]] # [moveToNewOwnersRoot [<Boolean>]]
# [updatesheetprotectedranges [<Boolean>]] # [updatesheetprotectedranges [<Boolean>]]
# [sendemail] [emailmessage <String>] # [sendemail] [emailmessage <String>]
@@ -59035,14 +59057,15 @@ def createDriveFileACL(users, useDomainAdminAccess=False):
fileNameTitle = 'title' if not GC.Values[GC.DRIVE_V3_NATIVE_NAMES] else 'name' fileNameTitle = 'title' if not GC.Values[GC.DRIVE_V3_NATIVE_NAMES] else 'name'
fileIdEntity = getDriveFileEntity() fileIdEntity = getDriveFileEntity()
body = {} body = {}
body['type'] = getChoice(DRIVEFILE_ACL_PERMISSION_TYPES) body['type'] = permType = getChoice(DRIVEFILE_ACL_PERMISSION_TYPES)
if body['type'] != 'anyone': if permType != 'anyone':
if body['type'] != 'domain': if permType != 'domain':
body['emailAddress'] = permissionId = getEmailAddress() body['emailAddress'] = permissionId = getEmailAddress()
else: else:
body['domain'] = permissionId = getString(Cmd.OB_DOMAIN_NAME) body['domain'] = permissionId = getString(Cmd.OB_DOMAIN_NAME)
else: else:
permissionId = 'anyone' permissionId = 'anyone'
mapPermissionsDomains = {}
while Cmd.ArgumentsRemaining(): while Cmd.ArgumentsRemaining():
myarg = getArgument() myarg = getArgument()
if myarg == 'withlink': if myarg == 'withlink':
@@ -59056,6 +59079,9 @@ def createDriveFileACL(users, useDomainAdminAccess=False):
body['role'] = getChoice(DRIVEFILE_ACL_ROLES_MAP, mapChoice=True) body['role'] = getChoice(DRIVEFILE_ACL_ROLES_MAP, mapChoice=True)
if body['role'] == 'owner': if body['role'] == 'owner':
sendNotificationEmail = _transferOwnership = True sendNotificationEmail = _transferOwnership = True
elif myarg == 'mappermissionsdomain':
oldDomain = getString(Cmd.OB_DOMAIN_NAME).lower()
mapPermissionsDomains[oldDomain] = getString(Cmd.OB_DOMAIN_NAME).lower()
elif myarg == 'enforcesingleparent': elif myarg == 'enforcesingleparent':
deprecatedArgument(myarg) deprecatedArgument(myarg)
elif myarg == 'movetonewownersroot': elif myarg == 'movetonewownersroot':
@@ -59086,6 +59112,18 @@ def createDriveFileACL(users, useDomainAdminAccess=False):
_checkFileIdEntityDomainAccess(fileIdEntity, useDomainAdminAccess) _checkFileIdEntityDomainAccess(fileIdEntity, useDomainAdminAccess)
if 'role' not in body: if 'role' not in body:
missingArgumentExit(f'role {formatChoiceList(DRIVEFILE_ACL_ROLES_MAP)}') missingArgumentExit(f'role {formatChoiceList(DRIVEFILE_ACL_ROLES_MAP)}')
if mapPermissionsDomains:
if permType != 'anyone':
if permType != 'domain':
atLoc = permissionId.find('@')
if atLoc != -1:
mappedDomain = mapPermissionsDomains.get(permissionId[atLoc+1:], None)
if mappedDomain:
body['emailAddress'] = permissionId = f"{permissionId[:atLoc]}@{mappedDomain}"
else:
mappedDomain = mapPermissionsDomains.get(permissionId, None)
if mappedDomain:
body['domain'] = permissionId = mappedDomain
_validatePermissionOwnerType(roleLocation, body) _validatePermissionOwnerType(roleLocation, body)
_validatePermissionAttributes('allowfilediscovery/withlink', withLinkLocation, body, 'allowFileDiscovery', ['anyone', 'domain']) _validatePermissionAttributes('allowfilediscovery/withlink', withLinkLocation, body, 'allowFileDiscovery', ['anyone', 'domain'])
_validatePermissionAttributes('expiration', expirationLocation, body, 'expirationTime', ['user', 'group']) _validatePermissionAttributes('expiration', expirationLocation, body, 'expirationTime', ['user', 'group'])
@@ -65227,10 +65265,10 @@ def _decodeHeader(header):
# gam <UserTypeEntity> forward message|messages recipient|to <RecipientEntity> # gam <UserTypeEntity> forward message|messages recipient|to <RecipientEntity>
# (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_forward <Number>])|(ids <MessageIDEntity>) # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_forward <Number>])|(ids <MessageIDEntity>)
# [subject <String>] [altcharset <String>] # [subject <String>] [addorigfieldstosubject [<Boolean>]] [altcharset <String>]
# gam <UserTypeEntity> forward thread|threads recipient|to <RecipientEntity> # gam <UserTypeEntity> forward thread|threads recipient|to <RecipientEntity>
# (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_forward <Number>])|(ids <ThreadIDEntity>) # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_forward <Number>])|(ids <ThreadIDEntity>)
# [subject <String>] [altcharset <String>] # [subject <String>] [addorigfieldstosubject [<Boolean>]] [altcharset <String>]
def forwardMessagesThreads(users, entityType): def forwardMessagesThreads(users, entityType):
def getRecipients(): def getRecipients():
if checkArgumentPresent('select'): if checkArgumentPresent('select'):
@@ -65241,7 +65279,7 @@ def forwardMessagesThreads(users, entityType):
checkArgumentPresent({'recipient', 'recipients', 'to'}) checkArgumentPresent({'recipient', 'recipients', 'to'})
recipients = getRecipients() recipients = getRecipients()
parameters = _initMessageThreadParameters(entityType, False, 1) parameters = _initMessageThreadParameters(entityType, False, 1)
includeSpamTrash = False addOriginalFieldsToSubject = includeSpamTrash = False
subject = '' subject = ''
encodings = [UTF8] encodings = [UTF8]
while Cmd.ArgumentsRemaining(): while Cmd.ArgumentsRemaining():
@@ -65250,6 +65288,8 @@ def forwardMessagesThreads(users, entityType):
pass pass
elif myarg == 'subject': elif myarg == 'subject':
subject = getString(Cmd.OB_STRING) subject = getString(Cmd.OB_STRING)
elif myarg == 'addorigfieldstosubject':
addOriginalFieldsToSubject = getBoolean()
elif myarg == 'altcharset': elif myarg == 'altcharset':
encodings.append(getString(Cmd.OB_CHAR_SET)) encodings.append(getString(Cmd.OB_CHAR_SET))
else: else:
@@ -65338,6 +65378,12 @@ def forwardMessagesThreads(users, entityType):
if header in message: if header in message:
del message[header] del message[header]
message['To'] = msgTo message['To'] = msgTo
if addOriginalFieldsToSubject:
msgSubject += ' (Original'
for header in ['From', 'To', 'Date']:
if header in message:
msgSubject += f' {header}: {message[header]}'
msgSubject += ')'
message['Subject'] = msgSubject message['Subject'] = msgSubject
try: try:
result = callGAPI(gmail.users().messages(), 'send', result = callGAPI(gmail.users().messages(), 'send',
@@ -67330,12 +67376,6 @@ EMAILSETTINGS_FORWARD_POP_ACTION_CHOICE_MAP = {
'trash': 'trash', 'trash': 'trash',
} }
# gam <UserTypeEntity> forward message|messages recipient|to <RecipientEntity>
# (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_forward <Number>])|(ids <MessageIDEntity>)
# [subject <String>]
# gam <UserTypeEntity> forward thread|threads recipient|to <RecipientEntity>
# (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_forward <Number>])|(ids <ThreadIDEntity>)
# [subject <String>]
# gam <UserTypeEntity> forward <FalseValues> # gam <UserTypeEntity> forward <FalseValues>
# gam <UserTypeEntity> forward <TrueValues> keep|leaveininbox|archive|delete|trash|markread <EmailAddress> # gam <UserTypeEntity> forward <TrueValues> keep|leaveininbox|archive|delete|trash|markread <EmailAddress>
def setForward(users): def setForward(users):