Exemple #1
0
        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);
        }
Exemple #2
0
        /// <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);
        }
Exemple #3
0
        /// <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));
        }