mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-04 03:33:44 +00:00
Handle API additional errors in update events, part II
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
7.07.10
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
to handle the following error:
|
||||
```
|
||||
ERROR: 400: eventTypeRestriction - Attendees cannot be added to 'fromGmail' event with this visibility setting.
|
||||
```
|
||||
|
||||
7.07.09
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
|
@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||
__version__ = '7.07.09'
|
||||
__version__ = '7.07.10'
|
||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@ -39299,7 +39299,7 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
|
||||
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR,
|
||||
GAPI.INVALID, GAPI.REQUIRED, GAPI.TIME_RANGE_EMPTY, GAPI.EVENT_DURATION_EXCEEDS_LIMIT,
|
||||
GAPI.REQUIRED_ACCESS_LEVEL, GAPI.CANNOT_CHANGE_ORGANIZER_OF_INSTANCE,
|
||||
GAPI.MALFORMED_WORKING_LOCATION_EVENT],
|
||||
GAPI.MALFORMED_WORKING_LOCATION_EVENT, GAPI.EVENT_TYPE_RESTRICTION],
|
||||
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.BACKEND_ERROR],
|
||||
calendarId=calId, eventId=eventId, conferenceDataVersion=1, sendUpdates=parameters['sendUpdates'], supportsAttachments=True,
|
||||
body=body, fields=pfields)
|
||||
@ -39315,7 +39315,8 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
|
||||
break
|
||||
entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, eventId], str(e), j, jcount)
|
||||
except (GAPI.forbidden, GAPI.backendError, GAPI.invalid, GAPI.required, GAPI.timeRangeEmpty, GAPI.eventDurationExceedsLimit,
|
||||
GAPI.requiredAccessLevel, GAPI.cannotChangeOrganizerOfInstance, GAPI.malformedWorkingLocationEvent) as e:
|
||||
GAPI.requiredAccessLevel, GAPI.cannotChangeOrganizerOfInstance, GAPI.malformedWorkingLocationEvent,
|
||||
GAPI.eventTypeRestriction) as e:
|
||||
entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, eventId], str(e), j, jcount)
|
||||
except GAPI.notACalendarUser:
|
||||
userCalServiceNotEnabledWarning(calId, i, count)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
|
||||
# Copyright (C) 2025 Ross Scroggs All Rights Reserved.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
@ -72,6 +72,7 @@ DOMAIN_POLICY = 'domainPolicy'
|
||||
DOWNLOAD_QUOTA_EXCEEDED = 'downloadQuotaExceeded'
|
||||
DUPLICATE = 'duplicate'
|
||||
EVENT_DURATION_EXCEEDS_LIMIT = 'eventDurationExceedsLimit'
|
||||
EVENT_TYPE_RESTRICTION = 'eventTypeRestriction'
|
||||
EXPIRATION_DATES_MUST_BE_IN_THE_FUTURE = 'expirationDatesMustBeInTheFuture'
|
||||
EXPIRATION_DATE_NOT_ALLOWED_FOR_SHARED_DRIVE_MEMBERS = 'expirationDateNotAllowedForSharedDriveMembers'
|
||||
FAILED_PRECONDITION = 'failedPrecondition'
|
||||
@ -457,6 +458,8 @@ class duplicate(Exception):
|
||||
pass
|
||||
class eventDurationExceedsLimit(Exception):
|
||||
pass
|
||||
class eventTypeRestriction(Exception):
|
||||
pass
|
||||
class expirationDatesMustBeInTheFuture(Exception):
|
||||
pass
|
||||
class expirationDateNotAllowedForSharedDriveMembers(Exception):
|
||||
@ -725,6 +728,7 @@ REASON_EXCEPTION_MAP = {
|
||||
DOWNLOAD_QUOTA_EXCEEDED: downloadQuotaExceeded,
|
||||
DUPLICATE: duplicate,
|
||||
EVENT_DURATION_EXCEEDS_LIMIT: eventDurationExceedsLimit,
|
||||
EVENT_TYPE_RESTRICTION: eventTypeRestriction,
|
||||
EXPIRATION_DATES_MUST_BE_IN_THE_FUTURE: expirationDatesMustBeInTheFuture,
|
||||
EXPIRATION_DATE_NOT_ALLOWED_FOR_SHARED_DRIVE_MEMBERS: expirationDateNotAllowedForSharedDriveMembers,
|
||||
FAILED_PRECONDITION: failedPrecondition,
|
||||
|
Reference in New Issue
Block a user