protected async Task <OfflineResponse> ExecuteOfflineRequest(List <IFunction> functions, RequestConfig requestConfig = null) { if (requestConfig == null) { requestConfig = new RequestConfig(); } RequestHandler requestHandler = new RequestHandler(this.Config, requestConfig); OfflineResponse response = await requestHandler.ExecuteOffline(functions).ConfigureAwait(false); return(response); }
/// <summary> /// Execute multiple Intacct API functions /// </summary> /// <param name="apiFunctions"></param> /// <param name="requestConfig"></param> /// <returns></returns> public async Task <OnlineResponse> ExecuteBatch(List <IFunction> apiFunctions, RequestConfig requestConfig = null) { if (requestConfig == null) { requestConfig = new RequestConfig(); } OnlineResponse response = await this.ExecuteOnlineRequest(apiFunctions, requestConfig).ConfigureAwait(false); if (requestConfig.Transaction == true) { foreach (Result result in response.Results) { result.EnsureStatusNotFailure(); } } return(response); }
/// <summary> /// Execute multiple functions to the Intacct API /// </summary> /// <param name="apiFunctions"></param> /// <param name="requestConfig"></param> /// <returns></returns> public async Task <OfflineResponse> ExecuteBatch(List <IFunction> apiFunctions, RequestConfig requestConfig = null) { if (requestConfig == null) { requestConfig = new RequestConfig(); } return(await this.ExecuteOfflineRequest(apiFunctions, requestConfig).ConfigureAwait(false)); }