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

Method __init__

O365/tasks_graph.py:651–674  ·  view source on GitHub ↗

Initialise the ToDo object. :param parent: parent object :type parent: Account :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) :param str main_resource: use thi

(self, *, parent=None, con=None, **kwargs)

Source from the content-addressed store, hash-verified

649 task_constructor = Task
650
651 def __init__(self, *, parent=None, con=None, **kwargs):
652 """Initialise the ToDo object.
653
654 :param parent: parent object
655 :type parent: Account
656 :param Connection con: connection to use if no parent specified
657 :param Protocol protocol: protocol to use if no parent specified
658 (kwargs)
659 :param str main_resource: use this resource instead of parent resource
660 (kwargs)
661 """
662 if parent and con:
663 raise ValueError("Need a parent or a connection but not both")
664 self.con = parent.con if parent else con
665
666 # Choose the main_resource passed in kwargs over parent main_resource
667 main_resource = kwargs.pop("main_resource", None) or (
668 getattr(parent, "main_resource", None) if parent else None
669 )
670
671 super().__init__(
672 protocol=parent.protocol if parent else kwargs.get("protocol"),
673 main_resource=main_resource,
674 )
675
676 def __str__(self):
677 """Representation of the ToDo via the Graph api as a string."""

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected