Execute method

Future<ServiceResponseCollection<TResponse>> Execute()
Executes this request.

Implementation

Future<ServiceResponseCollection<TResponse>> Execute() async {
  ServiceResponseCollection<TResponse> serviceResponses =
      (await this.InternalExecute()) as ServiceResponseCollection<TResponse>;

  if (this.ErrorHandlingMode == ServiceErrorHandling.ThrowOnError) {
    EwsUtilities.Assert(
        serviceResponses.Count == 1,
        "MultiResponseServiceRequest.Execute",
        "ServiceErrorHandling.ThrowOnError error handling is only valid for singleton request");

    serviceResponses[0].ThrowIfNecessary();
  }

  return serviceResponses;
}