Ejemplo n.º 1
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.ByteModel        = new ByteModel(this);
     this.BaseUri          = new Uri("http://localhost");
     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();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.ByteModel        = new ByteModel(this);
     this.BaseUri          = new System.Uri("http://localhost");
     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();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <byte[]> GetNonAsciiAsync(this IByteModel operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetNonAsciiWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Get empty byte 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 <byte[]> GetEmptyAsync(this IByteModel operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetEmptyWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static byte[] GetNonAscii(this IByteModel operations)
 {
     return(Task.Factory.StartNew(s => ((IByteModel)s).GetNonAsciiAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Get empty byte value ''
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <byte[]> GetEmptyAsync(this IByteModel operations, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpOperationResponse <byte[]> result = await operations.GetEmptyWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='byteBody'>
 /// Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PutNonAsciiAsync(this IByteModel operations, byte[] byteBody, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PutNonAsciiWithHttpMessagesAsync(byteBody, null, cancellationToken).ConfigureAwait(false);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='byteBody'>
 /// Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </param>
 public static void PutNonAscii(this IByteModel operations, byte[] byteBody)
 {
     Task.Factory.StartNew(s => ((IByteModel)s).PutNonAsciiAsync(byteBody), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static byte[] GetNonAscii(this IByteModel operations)
 {
     return(operations.GetNonAsciiAsync().GetAwaiter().GetResult());
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Get empty byte value ''
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static byte[] GetEmpty(this IByteModel operations)
 {
     return(operations.GetEmptyAsync().GetAwaiter().GetResult());
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='byteBody'>
 /// Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)
 /// </param>
 public static void PutNonAscii(this IByteModel operations, byte[] byteBody)
 {
     operations.PutNonAsciiAsync(byteBody).GetAwaiter().GetResult();
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Get empty byte value ''
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static byte[] GetEmpty(this IByteModel operations)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IByteModel)s).GetEmptyAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }