def __init__(
        self,
        credentials: Optional[Union[TokenCredential, AsyncTokenCredential]] = None,
        scopes: Optional[List[str]] = None,
        request_adapter: Optional[GraphRequestAdapter] = None,
    ) -> None:
        """Constructs a client instance to use for making requests to the 
        Microsoft Graph v.1.0 API.

        Args:
            credentials (Union[TokenCredential, AsyncTokenCredential]): The
            tokenCredential to use for authentication. 
            scopes (Optional[List[str]]): The scopes to use for authentication.
            Defaults to ['https://graph.microsoft.com/.default'].
            request_adapter (Optional[GraphRequestAdapter], optional): The request
            adapter to use for requests. Defaults to None.
        """

        if not request_adapter:
            if not credentials:
                raise ValueError("Missing request adapter or valid credentials")

            if scopes:
                auth_provider = AzureIdentityAuthenticationProvider(credentials, scopes=scopes)
            else:
                auth_provider = AzureIdentityAuthenticationProvider(credentials)

            request_adapter = GraphRequestAdapter(auth_provider)

        super().__init__(request_adapter)
Constructs a client instance to use for making requests to the 
        Microsoft Graph v.1.0 API.

        Args:
            credentials (Union[TokenCredential, AsyncTokenCredential]): The
            tokenCredential to use for authentication. 
            scopes (Optional[List[str]]): The scopes to use for authentication.
            Defaults to ['https://graph.microsoft.com/.default'].
            request_adapter (Optional[GraphRequestAdapter], optional): The request
            adapter to use for requests. Defaults to None.
        
msgraph/graph_service_client.py