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

Method as_params

O365/utils/utils.py:723–743  ·  view source on GitHub ↗

Returns the filters, orders, select, expands and search as query parameters :rtype: dict

(self)

Source from the content-addressed store, hash-verified

721 return self
722
723 def as_params(self):
724 """ Returns the filters, orders, select, expands and search as query parameters
725
726 :rtype: dict
727 """
728 params = {}
729 if self.has_filters:
730 params['$filter'] = self.get_filters()
731 if self.has_order:
732 params['$orderby'] = self.get_order()
733 if self.has_expands and not self.has_selects:
734 params['$expand'] = self.get_expands()
735 if self.has_selects and not self.has_expands:
736 params['$select'] = self.get_selects()
737 if self.has_expands and self.has_selects:
738 params['$expand'] = '{}($select={})'.format(self.get_expands(), self.get_selects())
739 if self._search:
740 params['$search'] = self._search
741 params.pop('$filter', None)
742 params.pop('$orderby', None)
743 return params
744
745 @property
746 def has_filters(self):

Callers 15

get_itemsMethod · 0.80
searchMethod · 0.80
_base_get_listMethod · 0.80
searchMethod · 0.80
get_occurrencesMethod · 0.80
get_eventsMethod · 0.80
get_eventMethod · 0.80
get_usersMethod · 0.80
_get_userMethod · 0.80
get_worksheetMethod · 0.80
get_filterMethod · 0.80

Calls 4

get_filtersMethod · 0.95
get_orderMethod · 0.95
get_expandsMethod · 0.95
get_selectsMethod · 0.95

Tested by

no test coverage detected