Build a query to apply OData filters https://docs.microsoft.com/en-us/graph/query-parameters :param str attribute: attribute to apply the query for :param Protocol protocol: protocol to use for connecting
(self, attribute=None, *, protocol)
| 628 | } |
| 629 | |
| 630 | def __init__(self, attribute=None, *, protocol): |
| 631 | """ Build a query to apply OData filters |
| 632 | https://docs.microsoft.com/en-us/graph/query-parameters |
| 633 | |
| 634 | :param str attribute: attribute to apply the query for |
| 635 | :param Protocol protocol: protocol to use for connecting |
| 636 | """ |
| 637 | self.protocol = protocol() if isinstance(protocol, type) else protocol |
| 638 | self._attribute = None |
| 639 | self._chain = None |
| 640 | self.new(attribute) |
| 641 | self._negation = False |
| 642 | self._filters = [] # store all the filters |
| 643 | self._order_by = OrderedDict() |
| 644 | self._selects = set() |
| 645 | self._expands = set() |
| 646 | self._search = None |
| 647 | self._open_group_flag = [] # stores if the next attribute must be grouped |
| 648 | self._close_group_flag = [] # stores if the last attribute must be closing a group |
| 649 | |
| 650 | def __str__(self): |
| 651 | return 'Filter: {}\nOrder: {}\nSelect: {}\nExpand: {}\nSearch: {}'.format(self.get_filters(), |