internal static NamespaceLongRunningOperation CreateLongRunningOperation( string operationName, NamespaceLongRunningResponse longRunningResponse) { if (string.IsNullOrWhiteSpace(operationName)) { throw new ArgumentNullException("operationName"); } if (longRunningResponse == null) { throw new ArgumentNullException("longRunningResponse"); } var result = new NamespaceLongRunningOperation { OperationName = operationName, OperationLink = longRunningResponse.OperationStatusLink, RetryAfter = TimeSpan.FromSeconds(longRunningResponse.RetryAfter), Status = longRunningResponse.Status, Error = (longRunningResponse.Error != null) ? longRunningResponse.Error.Message : null }; return result; }
internal static NamespaceLongRunningOperation CreateLongRunningOperation( string operationName, NamespaceLongRunningResponse longRunningResponse) { if (string.IsNullOrWhiteSpace(operationName)) { throw new ArgumentNullException("operationName"); } if (longRunningResponse == null) { throw new ArgumentNullException("longRunningResponse"); } var result = new NamespaceLongRunningOperation { OperationName = operationName, OperationLink = longRunningResponse.OperationStatusLink, RetryAfter = TimeSpan.FromSeconds(longRunningResponse.RetryAfter), Status = longRunningResponse.Status, Error = (longRunningResponse.Error != null) ? longRunningResponse.Error.Message : null }; return(result); }
internal NamespaceLongRunningOperation GetLongRunningOperationStatus(NamespaceLongRunningOperation longRunningOperation) { var response = Client.Namespaces.GetLongRunningOperationStatus(longRunningOperation.OperationLink); RetryAfter(response, Client.LongRunningOperationInitialTimeout); var result = NamespaceLongRunningOperation.CreateLongRunningOperation(longRunningOperation.OperationName, response as NamespaceLongRunningResponse); return result; }