Beispiel #1
0
def buildCalendarDataGAPIObject(calname):
    calendarId = normalizeCalendarId(calname)

    # Try to impersonate the calendar owner. If we fail, fall back to using
    # admin for authentication. Resource calendars cannot be impersonated,
    # so we need to access them as the admin.
    cal = None
    if not calname.endswith('.calendar.google.com'):
        cal = gam.buildGAPIServiceObject('calendar', calendarId, False)
    if cal is None:
        _, cal = buildCalendarGAPIObject(gam._getValueFromOAuth('email'))
    return (calendarId, cal)
Beispiel #2
0
def buildCalendarGAPIObject(calname):
    calendarId = normalizeCalendarId(calname)
    return (calendarId, gam.buildGAPIServiceObject('calendar', calendarId))
Beispiel #3
0
def build_dwd(api='cloudidentity'):
    admin = gam._get_admin_email()
    return gam.buildGAPIServiceObject(api, admin, True)
Beispiel #4
0
TESTOUPARENT = '/Test'
TESTSCHEMA = 'TestSchema'
TESTUSER = '******' + '@' + DOMAIN_NAME
TESTUSER_ALIAS = 'testuser1' + 'alias@' + DOMAIN_NAME

customer = 'my_customer'

# Configuration
gam.SetGlobalVariables(GAMCFG)

# Version
print(gam.Version())

# Drive v3 API

gapiDriveObj = gam.buildGAPIServiceObject(API.DRIVE3, TESTUSER)

# DriveAbout
print('\nDriveAbout')
result = gam.DriveAbout(gapiDriveObj, fields='user/displayName,storageQuota')
print(result)

print('\nDriveFilesList')
result = gam.DriveFilesList(gapiDriveObj,
                            corpora='user',
                            q="'me' in owners",
                            orderBy='folder,name',
                            fields='id,name')
print(result)

# Gmail API
Beispiel #5
0
def build():
    return gam.buildGAPIServiceObject('chat', act_as=None, scopes=CHAT_SCOPES)