class_docstr: The Microsoft Teams handler implementation.
class_docstr_tok: ["The","Microsoft","Teams","handler","implementation","."]
docstr: Set up the connection required by the handler.
  
  Returns
  -------
  MSGraphAPITeamsClient
      Client object for accessing the Microsoft Graph API.
docstr_tok: ["Set","up","the","connection","required","by","the","handler",".","Returns","--","--","--","-","MSGraphAPITeamsClient","Client","object","for","accessing","the","Microsoft","Graph","API","."]
code: def connect(self) -> MSGraphAPITeamsClient:
      """
      Set up the connection required by the handler.
  
      Returns
      -------
      MSGraphAPITeamsClient
          Client object for accessing the Microsoft Graph API.
      """
  
      if self.is_connected and self.connection.check_connection():
          return self.connection
  
      # initialize the auth manager for the Microsoft Graph API
      ms_graph_api_auth_manager = MSGraphAPIAuthManager(
          handler_storage=self.handler_storage,
          scopes=self.connection_data.get(
              "scopes", ms_teams_handler_config.DEFAULT_SCOPES
          ),
          client_id=self.connection_data["client_id"],
          client_secret=self.connection_data["client_secret"],
          tenant_id=self.connection_data["tenant_id"],
          code=self.connection_data.get("code"),
      )
  
      # get access token from the auth manager for the Microsoft Graph API
      access_token = ms_graph_api_auth_manager.get_access_token()
  
      # pass the access token to the client for access to the Microsoft Graph API
      self.connection = MSGraphAPITeamsClient(access_token)
  
      self.is_connected = True
  
      return self.connection
  
file_path: mindsdb/mindsdb/integrations/handlers/ms_teams_handler/ms_teams_handler.py
imports: from typing import Text, Dict
  from mindsdb.utilities import log
  from mindsdb_sql import parse_sql
  from mindsdb.integrations.handlers.utilities.auth_utilities import MSGraphAPIAuthManager
  from mindsdb.integrations.handlers.ms_teams_handler.settings import ms_teams_handler_config
  from mindsdb.integrations.handlers.ms_teams_handler.ms_graph_api_teams_client import MSGraphAPITeamsClient
  from mindsdb.integrations.libs.response import HandlerStatusResponse
  from mindsdb.integrations.libs.api_handler import APIChatHandler
  from mindsdb.integrations.handlers.ms_teams_handler.ms_teams_tables import ChannelsTable, ChannelMessagesTable, ChatsTable, ChatMessagesTable
label_desc: Use image node_id 2 for calling the MSTeamsHandler obj's underlying member method code with example usage: obj.connect() and returns: self, self