本文整理汇总了Python中inbox.events.google.GoogleEventsProvider._get_google_service方法的典型用法代码示例。如果您正苦于以下问题:Python GoogleEventsProvider._get_google_service方法的具体用法?Python GoogleEventsProvider._get_google_service怎么用?Python GoogleEventsProvider._get_google_service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inbox.events.google.GoogleEventsProvider
的用法示例。
在下文中一共展示了GoogleEventsProvider._get_google_service方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: remote_create_event
# 需要导入模块: from inbox.events.google import GoogleEventsProvider [as 别名]
# 或者: from inbox.events.google.GoogleEventsProvider import _get_google_service [as 别名]
def remote_create_event(account, event, db_session):
provider = GoogleEventsProvider(account.id, account.namespace.id)
dump = provider.dump_event(event)
service = provider._get_google_service()
result = service.events().insert(calendarId=event.calendar.name,
body=dump).execute()
# The events crud API assigns a random uid to an event when creating it.
# We need to update it to the value returned by the Google calendar API.
event.uid = result['id']
db_session.commit()
示例2: remote_update_event
# 需要导入模块: from inbox.events.google import GoogleEventsProvider [as 别名]
# 或者: from inbox.events.google.GoogleEventsProvider import _get_google_service [as 别名]
def remote_update_event(account, event, db_session):
provider = GoogleEventsProvider(account.id, account.namespace.id)
dump = provider.dump_event(event)
service = provider._get_google_service()
service.events().update(calendarId=event.calendar.name,
eventId=event.uid, body=dump).execute()
示例3: remote_delete_event
# 需要导入模块: from inbox.events.google import GoogleEventsProvider [as 别名]
# 或者: from inbox.events.google.GoogleEventsProvider import _get_google_service [as 别名]
def remote_delete_event(account, event, db_session):
provider = GoogleEventsProvider(account.id, account.namespace.id)
service = provider._get_google_service()
service.events().delete(calendarId=event.calendar.name,
eventId=event.uid).execute()
示例4: remote_create
# 需要导入模块: from inbox.events.google import GoogleEventsProvider [as 别名]
# 或者: from inbox.events.google.GoogleEventsProvider import _get_google_service [as 别名]
def remote_create(account, event, db_session):
provider = GoogleEventsProvider(account.id, account.namespace.id)
dump = provider.dump_event(event)
service = provider._get_google_service()
service.events().insert(calendarId='primary', body=dump).execute()