Example #1
0
        /// <summary>
        /// Gets the status of the bulk operation.
        /// </summary>
        /// <returns><see cref="BulkOperationStatus{TStatus}"/></returns>
        /// <exception cref="FaultException{TDetail}">Thrown if a fault is returned from the Bing Ads service.</exception>
        /// <exception cref="OAuthTokenRequestException">Thrown if tokens can't be refreshed due to an error received from the Microsoft Account authorization server.</exception>
        public async Task <BulkOperationStatus <TStatus> > GetStatusAsync()
        {
            if (FinalStatus != null)
            {
                return(FinalStatus);
            }

            var currentStatus = await _statusProvider.GetCurrentStatus(_bulkServiceClient).ConfigureAwait(false);

            if (_statusProvider.IsFinalStatus(currentStatus))
            {
                FinalStatus = currentStatus;
            }

            return(currentStatus);
        }
 private bool OperationIsComplete()
 {
     return(_statusProvider.IsFinalStatus(_currentStatus));
 }