/// <summary> /// Gets the patching schedule of a redis cache (requires Premium SKU). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the redis cache. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RedisPatchScheduleInner> GetAsync(this IPatchSchedulesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or replace the patching schedule for Redis cache (requires Premium /// SKU). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the Redis cache. /// </param> /// <param name='scheduleEntriesProperty'> /// List of patch schedules for a Redis cache. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RedisPatchScheduleInner> CreateOrUpdateAsync(this IPatchSchedulesOperations operations, string resourceGroupName, string name, IList <ScheduleEntryInner> scheduleEntriesProperty, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, name, scheduleEntriesProperty, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or replace the patching schedule for redis cache. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the redis cache. /// </param> /// <param name='parameters'> /// Parameters to set patch schedules for redis cache. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RedisPatchSchedulesResponse> CreateOrUpdateAsync(this IPatchSchedulesOperations operations, string resourceGroupName, string name, RedisPatchSchedulesRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, name, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Redis = new RedisOperations(this); PatchSchedules = new PatchSchedulesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2016-04-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new 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 ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Deletes the patching schedule of a redis cache (requires Premium SKU). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the redis cache. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IPatchSchedulesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the patching schedule of a redis cache (requires Premium SKU). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the redis cache. /// </param> public static void Delete(this IPatchSchedulesOperations operations, string resourceGroupName, string name) { operations.DeleteAsync(resourceGroupName, name).GetAwaiter().GetResult(); }
/// <summary> /// Create or replace the patching schedule for Redis cache (requires Premium /// SKU). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the Redis cache. /// </param> /// <param name='parameters'> /// Parameters to set the patching schedule for Redis cache. /// </param> public static RedisPatchSchedule CreateOrUpdate(this IPatchSchedulesOperations operations, string resourceGroupName, string name, RedisPatchSchedule parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, name, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Gets the patching schedule of a redis cache (requires Premium SKU). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the redis cache. /// </param> public static RedisPatchSchedule Get(this IPatchSchedulesOperations operations, string resourceGroupName, string name) { return(operations.GetAsync(resourceGroupName, name).GetAwaiter().GetResult()); }
/// <summary> /// Gets all patch schedules in the specified redis cache (there is only one). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <RedisPatchScheduleInner> > ListByRedisResourceNextAsync(this IPatchSchedulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByRedisResourceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets all patch schedules in the specified redis cache (there is only one). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='cacheName'> /// The name of the Redis cache. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <RedisPatchSchedule> > ListByRedisResourceAsync(this IPatchSchedulesOperations operations, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByRedisResourceWithHttpMessagesAsync(resourceGroupName, cacheName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets all patch schedules in the specified redis cache (there is only one). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='cacheName'> /// The name of the Redis cache. /// </param> public static IPage <RedisPatchSchedule> ListByRedisResource(this IPatchSchedulesOperations operations, string resourceGroupName, string cacheName) { return(operations.ListByRedisResourceAsync(resourceGroupName, cacheName).GetAwaiter().GetResult()); }
/// <summary> /// Gets all patch schedules in the specified redis cache (there is only one). /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <RedisPatchSchedule> ListByRedisResourceNext(this IPatchSchedulesOperations operations, string nextPageLink) { return(operations.ListByRedisResourceNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the patching schedule for redis cache. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the redis cache. /// </param> public static void Delete(this IPatchSchedulesOperations operations, string resourceGroupName, string name) { Task.Factory.StartNew(s => ((IPatchSchedulesOperations)s).DeleteAsync(resourceGroupName, name), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Create or replace the patching schedule for redis cache. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='name'> /// The name of the redis cache. /// </param> /// <param name='parameters'> /// Parameters to set patch schedules for redis cache. /// </param> public static RedisPatchSchedulesResponse CreateOrUpdate(this IPatchSchedulesOperations operations, string resourceGroupName, string name, RedisPatchSchedulesRequest parameters) { return(Task.Factory.StartNew(s => ((IPatchSchedulesOperations)s).CreateOrUpdateAsync(resourceGroupName, name, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }