MCPcopy Index your code
hub / github.com/O365/python-o365 / update

Method update

O365/excel.py:1383–1414  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 4

build_urlMethod · 0.80
jsonMethod · 0.80
patchMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected