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

Method create_bucket

O365/planner.py:729–757  ·  view source on GitHub ↗

Creates a Bucket :param str name: the name of the bucket :param str order_hint: the order of the bucket. Default is on top. How to use order hints here: https://docs.microsoft.com/en-us/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0 :return: n

(self, name, order_hint=' !')

Source from the content-addressed store, hash-verified

727 **{self._cloud_data_key: data}, )
728
729 def create_bucket(self, name, order_hint=' !'):
730 """ Creates a Bucket
731
732 :param str name: the name of the bucket
733 :param str order_hint: the order of the bucket. Default is on top.
734 How to use order hints here: https://docs.microsoft.com/en-us/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0
735 :return: newly created bucket
736 :rtype: Bucket
737 """
738
739 if not name:
740 raise RuntimeError('Provide a name for the Bucket')
741
742 if not self.object_id:
743 return None
744
745 url = self.build_url(
746 self._endpoints.get('create_bucket'))
747
748 data = {'name': name, 'orderHint': order_hint, 'planId': self.object_id}
749
750 response = self.con.post(url, data=data)
751 if not response:
752 return None
753
754 bucket = response.json()
755
756 return self.bucket_constructor(parent=self,
757 **{self._cloud_data_key: bucket})
758
759 def update(self, **kwargs):
760 """ Updates this 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