コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
        }