M10Directory constructor

M10Directory(
  1. String host, {
  2. TokenProvider? tokenProvider,
  3. bool disableTls = false,
  4. int port = 443,
})

Creates an M10Directory instance for interacting with the directory service.

Parameters:

  • host (required): The hostname or IP address of the directory service.
  • tokenProvider (optional): A TokenProvider instance used to obtain access tokens for authorized operations. If not provided, operations requiring tokens will throw an exception.
  • disableTls (optional): A boolean flag indicating whether to disable TLS security for the connection. Defaults to false (secure connection).
  • port (optional): The port number to connect to on the directory service host. Defaults to 443 for HTTPS connections.

Throws:

Implementation

M10Directory(
  String host, {
  TokenProvider? tokenProvider,
  bool disableTls = false,
  int port = 443,
})  : _tokenProvider = tokenProvider,
      _client = DirectoryServiceClient(
        ClientChannel(
          host,
          port: port,
          options: ChannelOptions(
            credentials: disableTls
                ? const ChannelCredentials.insecure()
                : const ChannelCredentials.secure(),
          ),
        ),
      );