ConvertId method

Future<AlternateIdBase?> ConvertId(
  1. AlternateIdBase id,
  2. IdFormat destinationFormat
)
Converts Id from one format to another in a single call to EWS. The Id to convert. The destination format.

Implementation

Future<AlternateIdBase?> ConvertId(
  AlternateIdBase id,
  IdFormat destinationFormat,
) async {
  EwsUtilities.ValidateParam(id, "id");

  ServiceResponseCollection<ConvertIdResponse> responses =
      await InternalConvertIds(
        [id],
        destinationFormat,
        ServiceErrorHandling.ThrowOnError,
      );

  return responses[0].ConvertedId;
}