Skip to content

Commit

Permalink
Adding ActivityLogAlerts and ActionGroups API calls, PATCH operations…
Browse files Browse the repository at this point in the history
…, and the corresponding unit tests (#3520)

* Adding ActivityLogAlerts and ActionGroups API calls, PATH operations, and the corresponding unit tests

* Generating code from the 'current' branch of the Swagger specs repo

* Adding scenario tests

* Improving scenario tests and re-recording them

* Making sure the scenario tests point to the more recent version of the Resource Manager dll. Enabling tests for netcoreapp1.1

* Reverting netcoreapp1.1 test target since it fails to find the records.

* Returning generate.md to its Azure\psSdkJson6 state

* Re-enabling tests for netcoreapp1.1
  • Loading branch information
gucalder authored and shahabhijeet committed Aug 23, 2017
1 parent 1c93181 commit 0f85678
Show file tree
Hide file tree
Showing 155 changed files with 12,784 additions and 1,083 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Monitor.Management
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Monitor;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// Extension methods for ActionGroupsOperations.
/// </summary>
public static partial class ActionGroupsOperationsExtensions
{
/// <summary>
/// Create a new action group or update an existing 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='actionGroupName'>
/// The name of the action group.
/// </param>
/// <param name='actionGroup'>
/// The action group to create or use for the update.
/// </param>
public static ActionGroupResource CreateOrUpdate(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, ActionGroupResource actionGroup)
{
return operations.CreateOrUpdateAsync(resourceGroupName, actionGroupName, actionGroup).GetAwaiter().GetResult();
}

/// <summary>
/// Create a new action group or update an existing 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='actionGroupName'>
/// The name of the action group.
/// </param>
/// <param name='actionGroup'>
/// The action group to create or use for the update.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ActionGroupResource> CreateOrUpdateAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, ActionGroupResource actionGroup, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, actionGroupName, actionGroup, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Get an action group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='actionGroupName'>
/// The name of the action group.
/// </param>
public static ActionGroupResource Get(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName)
{
return operations.GetAsync(resourceGroupName, actionGroupName).GetAwaiter().GetResult();
}

/// <summary>
/// Get an action group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='actionGroupName'>
/// The name of the action group.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ActionGroupResource> GetAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, actionGroupName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Delete an action group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='actionGroupName'>
/// The name of the action group.
/// </param>
public static void Delete(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName)
{
operations.DeleteAsync(resourceGroupName, actionGroupName).GetAwaiter().GetResult();
}

/// <summary>
/// Delete an action group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='actionGroupName'>
/// The name of the action group.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.DeleteWithHttpMessagesAsync(resourceGroupName, actionGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}

/// <summary>
/// Get a list of all action groups in a subscription.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
public static IEnumerable<ActionGroupResource> ListBySubscriptionId(this IActionGroupsOperations operations)
{
return operations.ListBySubscriptionIdAsync().GetAwaiter().GetResult();
}

/// <summary>
/// Get a list of all action groups in a subscription.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IEnumerable<ActionGroupResource>> ListBySubscriptionIdAsync(this IActionGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListBySubscriptionIdWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Get a list of all action groups in a resource group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
public static IEnumerable<ActionGroupResource> ListByResourceGroup(this IActionGroupsOperations operations, string resourceGroupName)
{
return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
}

/// <summary>
/// Get a list of all action groups in a resource group.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IEnumerable<ActionGroupResource>> ListByResourceGroupAsync(this IActionGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Enable a receiver in an action group. This changes the receiver's status
/// from Disabled to Enabled.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='actionGroupName'>
/// The name of the action group.
/// </param>
/// <param name='receiverName'>
/// The name of the receiver to resubscribe.
/// </param>
public static void EnableReceiver(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, string receiverName)
{
operations.EnableReceiverAsync(resourceGroupName, actionGroupName, receiverName).GetAwaiter().GetResult();
}

/// <summary>
/// Enable a receiver in an action group. This changes the receiver's status
/// from Disabled to Enabled.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='actionGroupName'>
/// The name of the action group.
/// </param>
/// <param name='receiverName'>
/// The name of the receiver to resubscribe.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task EnableReceiverAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, string receiverName, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.EnableReceiverWithHttpMessagesAsync(resourceGroupName, actionGroupName, receiverName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}

}
}
Loading

0 comments on commit 0f85678

Please sign in to comment.