コード例 #1
0
 /// <summary>
 /// Get an invalid duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <System.TimeSpan?> GetInvalidAsync(this IDurationOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetInvalidWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Duration       = new DurationOperations(this);
     BaseUri        = new System.Uri("https://localhost");
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
コード例 #3
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.Duration       = new DurationOperations(this);
     this.BaseUri        = new System.Uri("https://localhost");
     this.AcceptLanguage = "en-US";
     this.LongRunningOperationRetryTimeout = 30;
     this.GenerateClientRequestId          = true;
     SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
         Converters            = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter>
         {
             new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
         Converters            = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter>
         {
             new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter());
 }
コード例 #4
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.Duration         = new DurationOperations(this);
     this.BaseUri          = new Uri("https://localhost");
     this.AcceptLanguage   = "en-US";
     SerializationSettings = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new ResourceJsonConverter());
     DeserializationSettings = new JsonSerializerSettings {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings.Converters.Add(new ResourceJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
コード例 #5
0
 /// <summary>
 /// Put a positive duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='durationBody'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PutPositiveDurationAsync(this IDurationOperations operations, System.TimeSpan durationBody, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PutPositiveDurationWithHttpMessagesAsync(durationBody, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #6
0
 /// <summary>
 /// Put a positive duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='durationBody'>
 /// </param>
 public static void PutPositiveDuration(this IDurationOperations operations, System.TimeSpan durationBody)
 {
     Task.Factory.StartNew(s => ((IDurationOperations)s).PutPositiveDurationAsync(durationBody), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #7
0
 /// <summary>
 /// Get null duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static AzureOperationResponse <System.TimeSpan?> GetNullWithHttpMessages(this IDurationOperations operations, Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.GetNullWithHttpMessagesAsync(customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
コード例 #8
0
 /// <summary>
 /// Get null duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static System.TimeSpan?GetNull(this IDurationOperations operations)
 {
     return(Task.Factory.StartNew(s => ((IDurationOperations)s).GetNullAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #9
0
 /// <summary>
 /// Put a positive duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='durationBody'>
 /// </param>
 public static void PutPositiveDuration(this IDurationOperations operations, System.TimeSpan durationBody)
 {
     operations.PutPositiveDurationAsync(durationBody).GetAwaiter().GetResult();
 }
コード例 #10
0
 /// <summary>
 /// Get null duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static System.TimeSpan?GetNull(this IDurationOperations operations)
 {
     return(operations.GetNullAsync().GetAwaiter().GetResult());
 }
コード例 #11
0
 /// <summary>
 /// Put a positive duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='durationBody'>
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static AzureOperationResponse PutPositiveDurationWithHttpMessages(this IDurationOperations operations, TimeSpan durationBody, Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.PutPositiveDurationWithHttpMessagesAsync(durationBody, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
コード例 #12
0
        /// <summary>
        /// Get a positive duration value
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <TimeSpan?> GetPositiveDurationAsync(this IDurationOperations operations, CancellationToken cancellationToken = default(CancellationToken))
        {
            var _result = await operations.GetPositiveDurationWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false);

            return(_result.Body);
        }
コード例 #13
0
 /// <summary>
 /// Get a positive duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <System.TimeSpan?> GetPositiveDurationAsync(this IDurationOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetPositiveDurationWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #14
0
 /// <summary>
 /// Get a positive duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static System.TimeSpan?GetPositiveDuration(this IDurationOperations operations)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IDurationOperations)s).GetPositiveDurationAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #15
0
 /// <summary>
 /// Get null duration value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static Microsoft.Rest.Azure.AzureOperationResponse <System.TimeSpan?> GetNullWithHttpMessages(this IDurationOperations operations, System.Collections.Generic.Dictionary <string, System.Collections.Generic.List <string> > customHeaders = null)
 {
     return(operations.GetNullWithHttpMessagesAsync(customHeaders, System.Threading.CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
コード例 #16
0
        /// <summary>
        /// Get null duration value
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <TimeSpan?> GetNullAsync(this IDurationOperations operations, CancellationToken cancellationToken = default(CancellationToken))
        {
            AzureOperationResponse <TimeSpan?> result = await operations.GetNullWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }