Updates this table :param str name: the name of the table :param bool show_headers: whether or not to show the headers :param bool show_totals: whether or not to show the totals :param str style: the style of the table :return: Success or Failure
(self, *, name=None, show_headers=None, show_totals=None, style=None)
| 1381 | return self.row_constructor(parent=self, **{self._cloud_data_key: response.json()}) |
| 1382 | |
| 1383 | def update(self, *, name=None, show_headers=None, show_totals=None, style=None): |
| 1384 | """ |
| 1385 | Updates this table |
| 1386 | :param str name: the name of the table |
| 1387 | :param bool show_headers: whether or not to show the headers |
| 1388 | :param bool show_totals: whether or not to show the totals |
| 1389 | :param str style: the style of the table |
| 1390 | :return: Success or Failure |
| 1391 | """ |
| 1392 | if name is None and show_headers is None and show_totals is None and style is None: |
| 1393 | raise ValueError('Provide at least one parameter to update') |
| 1394 | data = {} |
| 1395 | if name: |
| 1396 | data['name'] = name |
| 1397 | if show_headers is not None: |
| 1398 | data['showHeaders'] = show_headers |
| 1399 | if show_totals is not None: |
| 1400 | data['showTotals'] = show_totals |
| 1401 | if style: |
| 1402 | data['style'] = style |
| 1403 | |
| 1404 | response = self.session.patch(self.build_url(''), data=data) |
| 1405 | if not response: |
| 1406 | return False |
| 1407 | |
| 1408 | data = response.json() |
| 1409 | self.name = data.get('name', self.name) |
| 1410 | self.show_headers = data.get('showHeaders', self.show_headers) |
| 1411 | self.show_totals = data.get('showTotals', self.show_totals) |
| 1412 | self.style = data.get('style', self.style) |
| 1413 | |
| 1414 | return True |
| 1415 | |
| 1416 | def delete(self): |
| 1417 | """ Deletes this table """ |