/// <summary> /// Create the watcher identified by watcher name. /// <see href="http://aka.ms/azureautomationsdk/watcheroperations" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of an Azure Resource group. /// </param> /// <param name='automationAccountName'> /// The name of the automation account. /// </param> /// <param name='watcherName'> /// The watcher name. /// </param> /// <param name='parameters'> /// The create or update parameters for watcher. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Watcher> CreateOrUpdateAsync(this IWatcherOperations operations, string resourceGroupName, string automationAccountName, string watcherName, Watcher parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, watcherName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }