Exemplo n.º 1
0
 public Task PutComplexPrimitiveDuration() => TestStatus(async(host, pipeline) =>
 {
     var value = new DurationWrapper
     {
         Field = XmlConvert.ToTimeSpan("P123DT22H14M12.011S")
     };
     return(await new PrimitiveClient(ClientDiagnostics, pipeline, host).PutDurationAsync(value));
 });
 public virtual Response PutDuration(DurationWrapper complexBody, CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("PrimitiveClient.PutDuration");
     scope.Start();
     try
     {
         return(RestClient.PutDuration(complexBody, cancellationToken));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
 public virtual async Task <Response> PutDurationAsync(DurationWrapper complexBody, CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("PrimitiveClient.PutDuration");
     scope.Start();
     try
     {
         return(await RestClient.PutDurationAsync(complexBody, cancellationToken).ConfigureAwait(false));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Put complex types with duration properties
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='complexBody'>
 /// Please put 'P123DT22H14M12.011S'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PutDurationAsync(this IPrimitive operations, DurationWrapper complexBody, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PutDurationWithHttpMessagesAsync(complexBody, null, cancellationToken).ConfigureAwait(false);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Put complex types with duration properties
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='complexBody'>
 /// Please put 'P123DT22H14M12.011S'
 /// </param>
 public static void PutDuration(this IPrimitive operations, DurationWrapper complexBody)
 {
     Task.Factory.StartNew(s => ((IPrimitive)s).PutDurationAsync(complexBody), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Put complex types with duration properties
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='complexBody'>
 /// Please put 'P123DT22H14M12.011S'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PutDurationAsync( this IPrimitive operations, DurationWrapper complexBody, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PutDurationWithHttpMessagesAsync(complexBody, null, cancellationToken).ConfigureAwait(false);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Put complex types with duration properties
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='complexBody'>
 /// Please put 'P123DT22H14M12.011S'
 /// </param>
 public static void PutDuration(this IPrimitive operations, DurationWrapper complexBody)
 {
     Task.Factory.StartNew(s => ((IPrimitive)s).PutDurationAsync(complexBody), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }