exchangelib/folders/collections.py
def find_items(self, q, shape=ID_ONLY, depth=None, additional_fields=None, order_fields=None,
                   calendar_view=None, page_size=None, max_items=None, offset=0):
        """Private method to call the FindItem service.

        :param q: a Q instance containing any restrictions
        :param shape: controls whether to return (id, chanegkey) tuples or Item objects. If additional_fields is
          non-null, we always return Item objects. (Default value = ID_ONLY)
        :param depth: controls the whether to return soft-deleted items or not. (Default value = None)
        :param additional_fields: the extra properties we want on the return objects. Default is no properties. Be aware
          that complex fields can only be fetched with fetch() (i.e. the GetItem service).
        :param order_fields: the SortOrder fields, if any (Default value = None)
        :param calendar_view: a CalendarView instance, if any (Default value = None)
        :param page_size: the requested number of items per page (Default value = None)
        :param max_items: the max number of items to return (Default value = None)
        :param offset: the offset relative to the first item in the item collection (Default value = 0)

        :return: a generator for the returned item IDs or items
        """
        if not self.folders:
            log.debug('Folder list is empty')
            return
        if q.is_never():
            log.debug('Query will never return results')
            return
        if shape not in SHAPE_CHOICES:
            raise ValueError("'shape' %s must be one of %s" % (shape, SHAPE_CHOICES))
        if depth is None:
            depth = self._get_default_item_traversal_depth()
        if depth not in ITEM_TRAVERSAL_CHOICES:
            raise ValueError("'depth' %s must be one of %s" % (depth, ITEM_TRAVERSAL_CHOICES))
        if additional_fields:
            for f in additional_fields:
                self.validate_item_field(field=f, version=self.account.version)
                if f.field.is_complex:
                    raise ValueError("find_items() does not support field '%s'. Use fetch() instead" % f.field.name)
        if calendar_view is not None and not isinstance(calendar_view, CalendarView):
            raise ValueError("'calendar_view' %s must be a CalendarView instance" % calendar_view)

        # Build up any restrictions
        if q.is_empty():
            restriction = None
            query_string = None
        elif q.query_string:
            restriction = None
            query_string = Restriction(q, folders=self.folders, applies_to=Restriction.ITEMS)
        else:
            restriction = Restriction(q, folders=self.folders, applies_to=Restriction.ITEMS)
            query_string = None
        log.debug(
            'Finding %s items in folders %s (shape: %s, depth: %s, additional_fields: %s, restriction: %s)',
            self.folders,
            self.account,
            shape,
            depth,
            additional_fields,
            restriction.q if restriction else None,
        )
        yield from FindItem(account=self.account, chunk_size=page_size).call(
            folders=self.folders,
            additional_fields=additional_fields,
            restriction=restriction,
            order_fields=order_fields,
            shape=shape,
            query_string=query_string,
            depth=depth,
            calendar_view=calendar_view,
            max_items=calendar_view.max_items if calendar_view else max_items,
            offset=offset,
        )
Private method to call the FindItem service.

        :param q: a Q instance containing any restrictions
        :param shape: controls whether to return (id, chanegkey) tuples or Item objects. If additional_fields is
          non-null, we always return Item objects. (Default value = ID_ONLY)
        :param depth: controls the whether to return soft-deleted items or not. (Default value = None)
        :param additional_fields: the extra properties we want on the return objects. Default is no properties. Be aware
          that complex fields can only be fetched with fetch() (i.e. the GetItem service).
        :param order_fields: the SortOrder fields, if any (Default value = None)
        :param calendar_view: a CalendarView instance, if any (Default value = None)
        :param page_size: the requested number of items per page (Default value = None)
        :param max_items: the max number of items to return (Default value = None)
        :param offset: the offset relative to the first item in the item collection (Default value = 0)

        :return: a generator for the returned item IDs or items
        
Private method to call the FindItem service.
Private method to call the FindItem service .
def find_items(self, q, shape=ID_ONLY, depth=None, additional_fields=None, order_fields=None,
                   calendar_view=None, page_size=None, max_items=None, offset=0):
        if not self.folders:
            log.debug('Folder list is empty')
            return
        if q.is_never():
            log.debug('Query will never return results')
            return
        if shape not in SHAPE_CHOICES:
            raise ValueError("'shape' %s must be one of %s" % (shape, SHAPE_CHOICES))
        if depth is None:
            depth = self._get_default_item_traversal_depth()
        if depth not in ITEM_TRAVERSAL_CHOICES:
            raise ValueError("'depth' %s must be one of %s" % (depth, ITEM_TRAVERSAL_CHOICES))
        if additional_fields:
            for f in additional_fields:
                self.validate_item_field(field=f, version=self.account.version)
                if f.field.is_complex:
                    raise ValueError("find_items() does not support field '%s'. Use fetch() instead" % f.field.name)
        if calendar_view is not None and not isinstance(calendar_view, CalendarView):
            raise ValueError("'calendar_view' %s must be a CalendarView instance" % calendar_view)
        if q.is_empty():
            restriction = None
            query_string = None
        elif q.query_string:
            restriction = None
            query_string = Restriction(q, folders=self.folders, applies_to=Restriction.ITEMS)
        else:
            restriction = Restriction(q, folders=self.folders, applies_to=Restriction.ITEMS)
            query_string = None
        log.debug(
            'Finding %s items in folders %s (shape: %s, depth: %s, additional_fields: %s, restriction: %s)',
            self.folders,
            self.account,
            shape,
            depth,
            additional_fields,
            restriction.q if restriction else None,
        )
        yield from FindItem(account=self.account, chunk_size=page_size).call(
            folders=self.folders,
            additional_fields=additional_fields,
            restriction=restriction,
            order_fields=order_fields,
            shape=shape,
            query_string=query_string,
            depth=depth,
            calendar_view=calendar_view,
            max_items=calendar_view.max_items if calendar_view else max_items,
            offset=offset,
        )
def find_items ( self , q , shape = ID_ONLY , depth = None , additional_fields = None , order_fields = None , calendar_view = None , page_size = None , max_items = None , offset = 0 ) : if not self . folders : log . debug ( 'Folder list is empty' ) return if q . is_never ( ) : log . debug ( 'Query will never return results' ) return if shape not in SHAPE_CHOICES : raise ValueError ( "'shape' %s must be one of %s" % ( shape , SHAPE_CHOICES ) ) if depth is None : depth = self . _get_default_item_traversal_depth ( ) if depth not in ITEM_TRAVERSAL_CHOICES : raise ValueError ( "'depth' %s must be one of %s" % ( depth , ITEM_TRAVERSAL_CHOICES ) ) if additional_fields : for f in additional_fields : self . validate_item_field ( field = f , version = self . account . version ) if f . field . is_complex : raise ValueError ( "find_items() does not support field '%s'. Use fetch() instead" % f . field . name ) if calendar_view is not None and not isinstance ( calendar_view , CalendarView ) : raise ValueError ( "'calendar_view' %s must be a CalendarView instance" % calendar_view ) if q . is_empty ( ) : restriction = None query_string = None elif q . query_string : restriction = None query_string = Restriction ( q , folders = self . folders , applies_to = Restriction . ITEMS ) else : restriction = Restriction ( q , folders = self . folders , applies_to = Restriction . ITEMS ) query_string = None log . debug ( 'Finding %s items in folders %s (shape: %s, depth: %s, additional_fields: %s, restriction: %s)' , self . folders , self . account , shape , depth , additional_fields , restriction . q if restriction else None , ) yield from FindItem ( account = self . account , chunk_size = page_size ) . call ( folders = self . folders , additional_fields = additional_fields , restriction = restriction , order_fields = order_fields , shape = shape , query_string = query_string , depth = depth , calendar_view = calendar_view , max_items = calendar_view . max_items if calendar_view else max_items , offset = offset , )
Private method to call the FindItem service.
Private method to call the FindItem service .
"""Private method to call the FindItem service.

        :param q: a Q instance containing any restrictions
        :param shape: controls whether to return (id, chanegkey) tuples or Item objects. If additional_fields is
          non-null, we always return Item objects. (Default value = ID_ONLY)
        :param depth: controls the whether to return soft-deleted items or not. (Default value = None)
        :param additional_fields: the extra properties we want on the return objects. Default is no properties. Be aware
          that complex fields can only be fetched with fetch() (i.e. the GetItem service).
        :param order_fields: the SortOrder fields, if any (Default value = None)
        :param calendar_view: a CalendarView instance, if any (Default value = None)
        :param page_size: the requested number of items per page (Default value = None)
        :param max_items: the max number of items to return (Default value = None)
        :param offset: the offset relative to the first item in the item collection (Default value = 0)

        :return: a generator for the returned item IDs or items
        """ # Build up any restrictions
a generator for the returned item IDs or items
a generator for the returned item IDs or items
self
q
a Q instance containing any restrictions
a Q instance containing any restrictions
shape
controls whether to return (id, chanegkey) tuples or Item objects. If additional_fields is
non-null, we always return Item objects. (Default value = ID_ONLY)
controls whether to return ( id chanegkey ) tuples or Item objects . If additional_fields is non - null we always return Item objects . ( Default value = ID_ONLY )
depth
controls the whether to return soft-deleted items or not. (Default value = None)
controls the whether to return soft - deleted items or not . ( Default value = None )
additional_fields
the extra properties we want on the return objects. Default is no properties. Be aware
that complex fields can only be fetched with fetch() .
the extra properties we want on the return objects . Default is no properties . Be aware that complex fields can only be fetched with fetch () .
order_fields
the SortOrder fields, if any (Default value = None)
the SortOrder fields if any ( Default value = None )
calendar_view
a CalendarView instance, if any (Default value = None)
a CalendarView instance if any ( Default value = None )
page_size
the requested number of items per page (Default value = None)
the requested number of items per page ( Default value = None )
max_items
the max number of items to return (Default value = None)
the max number of items to return ( Default value = None )
offset
the offset relative to the first item in the item collection (Default value = 0)
the offset relative to the first item in the item collection ( Default value = 0 )