Creates a Child Folder :param str name: the name of the new child folder :param str description: the description of the new child folder :return: newly created folder :rtype: drive.Folder
(self, name, description=None)
| 1111 | return self.get_items(limit=limit, query=query, order_by=order_by, batch=batch) |
| 1112 | |
| 1113 | def create_child_folder(self, name, description=None): |
| 1114 | """ Creates a Child Folder |
| 1115 | |
| 1116 | :param str name: the name of the new child folder |
| 1117 | :param str description: the description of the new child folder |
| 1118 | :return: newly created folder |
| 1119 | :rtype: drive.Folder |
| 1120 | """ |
| 1121 | |
| 1122 | if not self.object_id: |
| 1123 | return None |
| 1124 | |
| 1125 | url = self.build_url( |
| 1126 | self._endpoints.get('list_items').format(id=self.object_id)) |
| 1127 | |
| 1128 | data = {'name': name, 'folder': {}} |
| 1129 | if description: |
| 1130 | data['description'] = description |
| 1131 | |
| 1132 | response = self.con.post(url, data=data) |
| 1133 | if not response: |
| 1134 | return None |
| 1135 | |
| 1136 | folder = response.json() |
| 1137 | |
| 1138 | return self._classifier(folder)(parent=self, |
| 1139 | **{self._cloud_data_key: folder}) |
| 1140 | |
| 1141 | def download_contents(self, to_folder=None): |
| 1142 | """ This will download each file and folder sequentially. |
no test coverage detected