MCPcopy Create free account
hub / github.com/O365/python-o365 / create_plan

Method create_plan

O365/planner.py:1000–1023  ·  view source on GitHub ↗

Creates a Plan :param str owner: the id of the group that will own the plan :param str title: the title of the new plan. Default set to "Tasks" :return: newly created plan :rtype: Plan

(self, owner, title='Tasks')

Source from the content-addressed store, hash-verified

998 for plan in data.get('value', [])]
999
1000 def create_plan(self, owner, title='Tasks'):
1001 """ Creates a Plan
1002
1003 :param str owner: the id of the group that will own the plan
1004 :param str title: the title of the new plan. Default set to "Tasks"
1005 :return: newly created plan
1006 :rtype: Plan
1007 """
1008 if not owner:
1009 raise RuntimeError('Provide the owner (group_id)')
1010
1011 url = self.build_url(
1012 self._endpoints.get('create_plan'))
1013
1014 data = {'owner': owner, 'title': title}
1015
1016 response = self.con.post(url, data=data)
1017 if not response:
1018 return None
1019
1020 plan = response.json()
1021
1022 return self.plan_constructor(parent=self,
1023 **{self._cloud_data_key: plan})

Callers 1

setup_classMethod · 0.80

Calls 4

build_urlMethod · 0.80
jsonMethod · 0.80
getMethod · 0.45
postMethod · 0.45

Tested by 1

setup_classMethod · 0.64