Bind static method

Future<UserConfiguration> Bind(
  1. ExchangeService service,
  2. String name,
  3. FolderId parentFolderId,
  4. Set<UserConfigurationProperties> properties,
)
Binds to an existing user configuration and loads the specified properties. Calling this method results in a call to EWS. The service to which the user configuration is bound. The name of the user configuration. The Id of the folder containing the user configuration. The properties to load.

Implementation

static Future<UserConfiguration> Bind(
  ExchangeService service,
  String name,
  FolderId parentFolderId,
  Set<UserConfigurationProperties> properties,
) async {
  // service.GetUserConfiguration(name, parentFolderId, properties)
  EwsUtilities.ValidateParam(name, "name");
  EwsUtilities.ValidateParam(parentFolderId, "parentFolderId");

  GetUserConfigurationRequest request = GetUserConfigurationRequest(service);

  request.Name = name;
  request.ParentFolderId = parentFolderId;
  request.Properties = properties;

  UserConfiguration result = (await request.Execute())[0].UserConfiguration;

  result._isNew = false;

  return result;
}