-
Notifications
You must be signed in to change notification settings - Fork 67
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
Google Calendar Event ID Support #115
Comments
Hey @Foggy2 - Valid request! Let me know if I summarized it correctly:
|
@scrthq - Your summary looks good! |
@Foggy2 - awesome! Going to try working on it this weekend if I'm able to, I'll let you know! Also worth noting is that I've been on sort of a quest to removed any public Get-*List functions for a while. My plan of action is to allow the function to perform either a Get or List request depending on the parameter(s) passed to it. Any existing functions like What this looks like specifically for
Hopefully that's clear! Please do let me know if you have any questions/comments/concerns! The main takeaway is this will not break any scripts that leverage the existing *List function already. |
That makes perfect sense! No issues from me with what you intend to do. |
Hey @Foggy2 - Given how the values for PrivateExtendedProperty and SharedExtendedProperty are expected, what do you feel is most natural for how they should be handled in PowerShell-land? Visually, they're key-value pairs, which in my head makes sense as a hashtable or an array of hashtables, but the parameter value type is literally an array of strings, so: @(
'key1=value1'
'key2=value2'
etc etc....
) The 2 options that come to my mind are...
Link for reference: https://developers.google.com/calendar/v3/reference/events/list |
@scrthq - That is a good question. Having said that, in what format would the ExtendedProperties property of an event return data? Would it be best to maintain uniformity between putting data in and getting data out? If you do opt for the array of strings, perhaps adding some utility functions for easily parsing a hashtable to strings and vice versa is a compromise? |
@Foggy2 - I had a long reply to this, but then I started playing with it a bit more and this is the way I think this should go: For For
$existing = Get-GSCalendarEvent -EventId lkjasdflkjasldfjlasdf
New-GSCalendarEvent -Summary "New Event" -ExtendedProperties $existing.ExtendedProperties |
## 2.20.0 * [Issue #115](#115) * Renamed: `Get-GSCalendarEventList` to `Get-GSCalendarEvent` and set the original name as an exported Alias to the new name for backwards compatibility. * Added: `EventId` parameter to `Get-GSCalendarEvent` to specify individual event ID's to get instead of a filtered list. * Added: `PrivateExtendedProperty` parameter to `Get-GSCalendarEvent`. * Added: `SharedExtendedProperty` parameter to `Get-GSCalendarEvent`. * Added: `PrivateExtendedProperties` parameter to `New-GSCalendarEvent` and `Update-GSCalendarEvent`. * Added: `SharedExtendedProperties` parameter to `New-GSCalendarEvent` and `Update-GSCalendarEvent`. * Added: `ExtendedProperties` parameter to `New-GSCalendarEvent` and `Update-GSCalendarEvent`. * Added: `Id` parameter to `New-GSCalendarEvent` and `Update-GSCalendarEvent`. * [Issue #117](#117) * Fixed: Type error on `States` parameter of `Get-GSStudentGuardianInvitation`. * Miscellaneous * Updated Contributing doc with new Build script steps * Removed `DebugMode.ps1` script since it's no longer needed (use `build.ps1` instead)
@Foggy2 - v2.20.0 is out now with the updated! Enjoy! |
Is your feature request related to a problem? Please describe.
I am trying to implement a system where our school time tables are automatically published to Google Calendar for all users. With the added inclusion of the events being update upon room/staffing changes at the last minute.
So I am trying to determine an easy way to identify pre-existing events on a calendar and determine which classes they represent. So that details can be cross checked and updated where required.
Describe the solution you'd like
From reviewing the Google Calendar API reference. An obvious solution would be to use the customisable ID field for each event and embed a unique code that can be deciphered later on to identify the lesson/class.
Currently, the ID field is not supported by the
New-GSCalendarEvent
function.EDIT: In fact as I review the API reference further. The Extended Properties is probably a better fit for my needs as it will be more flexible by allowing the use of multiple custom key/value pairs. It appears that the
Get-GSCalendarEventList
could also support filtering events on these key/value pairs which would be very convenient and efficient to manage locally.So I think I could work with either but my preference in terms of flexibility would be that the Extended Properties be supported in the
New-GSCalendarEvent
andGet-GSCalendarEventList
commands.Describe alternatives you've considered
The alternatives for identifying events would be to match events based on other fields which could be messy but theoretically doable.
Or to locally cache the automatically generated IDs at event creation. I will be caching this data but my intention is to try and have my script be fault tolerant so that if the cache is corrupt or missing, it can re-parse all events and re-identify them. And also expire the cache periodically so that if an event differs between G-Suite and the cache it can be rectified.
The text was updated successfully, but these errors were encountered: