/// <summary> /// Modify properties of schedules. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> /// <param name='schedule'> /// A schedule. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ScheduleInner> UpdateAsync(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, ScheduleFragmentInner schedule, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, name, schedule, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists all applicable schedules /// </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 <ScheduleInner> > ListApplicableNextAsync(this ISchedulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListApplicableNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List schedules in a given lab. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <ScheduleInner> > ListAsync(this ISchedulesOperations operations, string resourceGroupName, string labName, ODataQuery <ScheduleInner> odataQuery = default(ODataQuery <ScheduleInner>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get schedule. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> /// <param name='expand'> /// Specify the $expand query. Example: 'properties($select=status)' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ScheduleInner> GetAsync(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists all applicable schedules /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Schedule> > ListApplicableAsync(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListApplicableWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or update a lab schedule. /// </summary> /// <remarks> /// Operation to create or update a lab schedule. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='body'> /// The request body. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='labName'> /// The name of the lab that uniquely identifies it within containing lab /// account. Used in resource URIs. /// </param> /// <param name='scheduleName'> /// The name of the schedule that uniquely identifies it within containing lab. /// Used in resource URIs. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Schedule> CreateOrUpdateAsync(this ISchedulesOperations operations, Schedule body, string resourceGroupName, string labName, string scheduleName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, labName, scheduleName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); OperationResults = new OperationResultsOperations(this); LabPlans = new LabPlansOperations(this); Images = new ImagesOperations(this); Labs = new LabsOperations(this); Users = new UsersOperations(this); VirtualMachines = new VirtualMachinesOperations(this); Schedules = new SchedulesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2021-10-01-preview"; 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 a schedule resource. /// </summary> /// <remarks> /// Operation to delete a schedule resource. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='labName'> /// The name of the lab that uniquely identifies it within containing lab /// account. Used in resource URIs. /// </param> /// <param name='scheduleName'> /// The name of the schedule that uniquely identifies it within containing lab. /// Used in resource URIs. /// </param> public static void Delete(this ISchedulesOperations operations, string resourceGroupName, string labName, string scheduleName) { operations.DeleteAsync(resourceGroupName, labName, scheduleName).GetAwaiter().GetResult(); }
/// <summary> /// List schedules in a given lab. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <Schedule> List(this ISchedulesOperations operations, string resourceGroupName, string labName, ODataQuery <Schedule> odataQuery = default(ODataQuery <Schedule>)) { return(operations.ListAsync(resourceGroupName, labName, odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// Get a lab Schedule. /// </summary> /// <remarks> /// Returns the properties of a lab Schedule. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='labName'> /// The name of the lab that uniquely identifies it within containing lab /// account. Used in resource URIs. /// </param> /// <param name='scheduleName'> /// The name of the schedule that uniquely identifies it within containing lab. /// Used in resource URIs. /// </param> public static Schedule Get(this ISchedulesOperations operations, string resourceGroupName, string labName, string scheduleName) { return(operations.GetAsync(resourceGroupName, labName, scheduleName).GetAwaiter().GetResult()); }
/// <summary> /// Get all schedules for a lab. /// </summary> /// <remarks> /// Returns a list of all schedules for a lab. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='labName'> /// The name of the lab that uniquely identifies it within containing lab /// account. Used in resource URIs. /// </param> /// <param name='filter'> /// The filter to apply to the operation. /// </param> public static IPage <Schedule> ListByLab(this ISchedulesOperations operations, string resourceGroupName, string labName, string filter = default(string)) { return(operations.ListByLabAsync(resourceGroupName, labName, filter).GetAwaiter().GetResult()); }
/// <summary> /// Modify properties of schedules. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> /// <param name='schedule'> /// A schedule. /// </param> public static Schedule Update(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, ScheduleFragment schedule) { return(operations.UpdateAsync(resourceGroupName, labName, name, schedule).GetAwaiter().GetResult()); }
/// <summary> /// Execute a schedule. This operation can take a while to complete. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginExecuteAsync(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginExecuteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Get schedule. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> /// <param name='expand'> /// Specify the $expand query. Example: 'properties($select=status)' /// </param> public static Schedule Get(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string)) { return(operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult()); }
/// <summary> /// Lists all applicable schedules /// </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 <Schedule> ListApplicableNext(this ISchedulesOperations operations, string nextPageLink) { return(operations.ListApplicableNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Update a lab schedule. /// </summary> /// <remarks> /// Operation to update a lab schedule. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='body'> /// The request body. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='labName'> /// The name of the lab that uniquely identifies it within containing lab /// account. Used in resource URIs. /// </param> /// <param name='scheduleName'> /// The name of the schedule that uniquely identifies it within containing lab. /// Used in resource URIs. /// </param> public static Schedule Update(this ISchedulesOperations operations, ScheduleUpdate body, string resourceGroupName, string labName, string scheduleName) { return(operations.UpdateAsync(body, resourceGroupName, labName, scheduleName).GetAwaiter().GetResult()); }
/// <summary> /// Execute a schedule. This operation can take a while to complete. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> public static void BeginExecute(this ISchedulesOperations operations, string resourceGroupName, string labName, string name) { operations.BeginExecuteAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); }
/// <summary> /// Lists all applicable schedules /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='name'> /// The name of the schedule. /// </param> public static IPage <Schedule> ListApplicable(this ISchedulesOperations operations, string resourceGroupName, string labName, string name) { return(operations.ListApplicableAsync(resourceGroupName, labName, name).GetAwaiter().GetResult()); }