/// <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(); }
/// <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(); }
/// <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); } }
/// <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); } }
/// <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()); }
/// <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); }
/// <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); }
/// <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(); }
/// <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()); }
/// <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()); }
/// <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(); }
/// <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()); }