GetDelegates method

Future<DelegateInformation> GetDelegates(
  1. Mailbox mailbox,
  2. bool includePermissions, [
  3. Iterable<UserId> userIds = const <UserId>[]
])
Retrieves the delegates of a specific mailbox. Calling this method results in a call to EWS. The mailbox to retrieve the delegates of. Indicates whether detailed permissions should be returned fro each delegate. The optional Ids of the delegate users to retrieve.

Implementation

Future<DelegateInformation> GetDelegates(
  Mailbox mailbox,
  bool includePermissions, [
  Iterable<UserId> userIds = const <UserId>[],
]) async {
  EwsUtilities.ValidateParam(mailbox, "mailbox");

  GetDelegateRequest request = GetDelegateRequest(this);

  request.Mailbox = mailbox;
  request.UserIds.addAll(userIds);
  request.IncludePermissions = includePermissions;

  GetDelegateResponse response = await request.Execute();
  DelegateInformation delegateInformation = DelegateInformation(
    response.DelegateUserResponses ?? <DelegateUserResponse>[],
    response.MeetingRequestsDeliveryScope,
  );

  return delegateInformation;
}