# Users - Calendars - [API documentation](#api-documentation) - [Definitions](#definitions) - [Calendar colors](#calendar-colors) - [Calendar selection](#calendar-selection) - [Display calendar UI settings](#display-calendar-ui-settings) - [Manage calendars](#manage-calendars) - [Create and remove calendars](#create-and-remove-calendars) - [Modify calendar settings](#modify-calendar-settings) - [Display calendar settings](#display-calendar-settings) - [Manage calendar lists](#manage-calendar-lists) - [Display specific calendars from list](#display-specific-calendars-from-list) - [Display calendar lists](#display-calendar-lists) ## API documentation * [Calendar API - Calendars](https://developers.google.com/google-apps/calendar/v3/reference/calendars) * [Calendar API - Calendar Lists](https://developers.google.com/google-apps/calendar/v3/reference/calendarList) ## Definitions * [``](Collections-of-Users) ``` ::= (.)+ ::= @ ::= ::= "(,)*" ::= | | | See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items ::= ::= |d: ::= "(,)*" ::= active|archived|provisioned|declined ::= all|"(,)*" ::= ::= "(,)*" ::= See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones ::= id: ::= || ::= editor|freebusy|freebusyreader|owner|reader|writer ::= (description )| (location )| (summary )| (timezone ) ::= conferenceproperties| description| id| location| summary| timezone ::= "(,)*" ::= minaccessrole | showdeleted| showhidden ::= | | (courses )| ((courses_with_teacher )|my_courses_as_teacher [coursestates ])| ((courses_with_student )|my_courses_as_student [coursestates ])| (resource )| (resources )| ((calendars ) | | | | ) See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items ::= allcalendars| primary| | | (courses )| ((courses_with_teacher )|my_courses_as_teacher [coursestates ])| ((courses_with_student )|my_courses_as_student [coursestates ])| (resource )| (resources )| ((calendars ) | | | | )| * See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items ::= autoaddhangouts| datefieldorder| defaulteventlength| format24hourtime| hideinvitations| hideweekends| locale| remindonrespondedeventsonly| showdeclinedevents| timezone| usekeyboardshortcuts| weekstart ::= "(,)*" ::= ::= amethyst|avocado|banana|basil|birch|blueberry| cherryblossom|citron|cobalt|cocoa|eucalyptus|flamingo| grape|graphite|lavender|mango|peacock|pistachio| pumpkin|radicchio|sage|tangerine|tomato|wisteria| ::= eventcreation|eventchange|eventcancellation|eventresponse|agenda ::= (,)*" ::= (backgroundcolor )| (colorindex|colorid )| (foregroundcolor )| (hidden )| (notification clear|(email ))| (reminder clear|(email|popup )|( email|popup))| (selected )| (summary ) ::= accessrole| backgroundcolor| colorid| conferenceproperties| defaultreminders| deleted| description| foregroundcolor| hidden| id| location| notificationsettings| primary| selected| summary| summaryoverride| timezone ::= "(,)*" ``` ## Calendar colors The calendar color grid presented in calendar.google.com and `` are related like this: ``` 21:radicchio 4:tangerine 11:citron 8:basil 16:blueberry 23:grape 22:cherryblossom 5:pumpkin 10:avacado 7:eucalyptus 17:lavender 1:cocoa 3:tomato 6:mango 9:pistachio 14:peacock 18:wisteria 19:graphite 2:flamingo 12:banana 13:sage 15:cobalt 24:amethyst 20:birch ``` ## Calendar selection * `allcalendars` - All calendars in a user's calendar list * `primary` - The user's primary calendar * `` - The address of a calendar in a user's calendar list * `` - The uniqueid of a calendar in a user's calendar list * `courses `- The calendars associated with a list of courses * `courses_with_teacher ` - The calendars associated with courses with `` as a teacher * `my_courses_as_teacher` - The calendars associated with the User from `` as a teacher * `courses_with_student ` - The calendars associated with courses with `` as a student * `my_courses_as_student` - The calendars associated with the User from `` as a student * `coursestates ` - Used with the previous four options to select courses in a particular state; the default is all * `resource ` - The calendar associated with a resource ID * `resources ` - The calendars associated with a list of resource IDs * `calendars ( | | | | )` - A collection of calendars: [Collections of Items](Collections-of-Items) * `+` - The calendars in a user's calendar list with the specified properites ## Display calendar UI settings ``` gam show calsettings [fields ] [formatjson] ``` By default, Gam displays the information as an indented list of keys and values. * `formatjson` - Display the fields in JSON format. ``` gam print calsettings [todrive *] [fields ] [formatjson [quotechar ]] ``` 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 ` 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. ## Manage calendars ### Create and remove calendars ``` gam create calendar gam remove calendars ``` ### Modify calendar settings ``` gam modify calendars ``` ### Display calendar settings ``` gam calendar show settings [fields ] [formatjson] ``` By default, Gam displays the information as an indented list of keys and values. * `formatjson` - Display the fields in JSON format. ``` gam calendar print settings [todrive *] [fields ] [formatjson [quotechar ]] ``` 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 ` 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. ## Manage calendar lists These commands manage a user's list of calendars. ``` gam add calendars * gam update calendars + gam delete calendars ``` ### Examples A student accidentally removed his course calendars and needs them back. ``` gam user student@domain.com add calendars my_courses_as_student ``` An advisor wants to monitor the course calendars for a student. ``` gam user advisor@domain.com add calendars courses_with_student student@domain.com ``` ## Display specific calendars from list ### Display as an indented list of keys and values. ``` gam info calendars [fields ] [permissions] [formatjson] ``` * `permissions` adds permission information for user owned calendars to the output. By default, Gam displays the information as an indented list of keys and values. * `formatjson` - Display the fields in JSON format. ## Display calendar lists ### Display as an indented list of keys and values. ``` gam show calendars [primary] * [noprimary] [nogroups] [noresources] [nosystem] [nousers] [fields ] [permissions] [formatjson] ``` By default, information for all visible, non-deleted calendars is shown. * `primary` - Limits the selection to the user's primary calendar * `` * `minaccessrole `- Limits the selection to those calendars where the user's role is at least `` * `showdeleted` - Adds deleted calendars to the selection * `showhidden` - Adds hidden calendars to the selection * `noprimary` - Do not display the users's primary calendar * `nogroups` - Do not display group calendars, email address ends in "@group.calendar.google.com" * `noresources` - Do not display resource calendars, email address ends in "@resource.calendar.google.com" * `nosystem` - Do not display system calendars, email address ends in "@group.v.calendar.google.com" * `nousers` - Do not display users calendars, email address ends in `domain` value from `gam.cfg`. * `permissions` adds permission information for user owned calendars to the output. By default, Gam displays the information as an indented list of keys and values. * `formatjson` - Display the fields in JSON format. ### Display as a CSV file. ``` gam print calendars [todrive *] [primary] * [noprimary] [nogroups] [noresources] [nosystem] [nousers] [fields ] [permissions] [formatjson] [delimiter ] [quotechar ] ``` By default, information for all visible, non-deleted calendars is shown. * `permissions` adds permission information for user owned calendars to the output. * `primary` - Limits the selection to the user's primary calendar * `` * `minaccessrole `- Limits the selection to those calendars where the user's role is at least `` * `showdeleted` - Adds deleted calendars to the selection * `showhidden` - Adds hidden calendars to the selection * `noprimary` - Do not display the users's primary calendar * `nogroups` - Do not display group calendars, email address ends in "@group.calendar.google.com" * `noresources` - Do not display resource calendars, email address ends in "@resource.calendar.google.com" * `nosystem` - Do not display system calendars, email address ends in "@group.v.calendar.google.com" * `nousers` - Do not display users calendars, email address ends in `domain` value from `gam.cfg`. By default, list items are separated by the `csv_output_field_delimiter' from `gam.cfg`. * `delimiter ` - Separate list items with `` 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 ` 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.