/// <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 <ActionGroupResourceInner> 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>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     AutoscaleSettings         = new AutoscaleSettingsOperations(this);
     AlertRules                = new AlertRulesOperations(this);
     AlertRuleIncidents        = new AlertRuleIncidentsOperations(this);
     ActivityLogAlerts         = new ActivityLogAlertsOperations(this);
     LogProfiles               = new LogProfilesOperations(this);
     ServiceDiagnosticSettings = new ServiceDiagnosticSettingsOperations(this);
     ActionGroups              = new ActionGroupsOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     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()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleDataSource>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleDataSource>("odata.type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleCondition>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleCondition>("odata.type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleAction>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleAction>("odata.type"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <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>
 /// Enable a receiver in an action group. This changes the receiver's status
 /// from Disabled to Enabled. This operation is only supported for Email or SMS
 /// receivers.
 /// </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>
 /// 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>
 /// 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 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());
 }
Пример #8
0
 /// <summary>
 /// Get the test notifications by the notification id
 /// </summary>
 /// <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='actionGroupName'>
 /// The name of the action group.
 /// </param>
 /// <param name='notificationId'>
 /// The notification id
 /// </param>
 public static TestNotificationDetailsResponse GetTestNotificationsAtActionGroupResourceLevel(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, string notificationId)
 {
     return(operations.GetTestNotificationsAtActionGroupResourceLevelAsync(resourceGroupName, actionGroupName, notificationId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Send test notifications to a set of provided receivers
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='notificationRequest'>
 /// The notification request body which includes the contact details
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TestNotificationResponse> BeginPostTestNotificationsAsync(this IActionGroupsOperations operations, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginPostTestNotificationsWithHttpMessagesAsync(notificationRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get the test notifications by the notification id
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='notificationId'>
 /// The notification id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TestNotificationDetailsResponse> GetTestNotificationsAsync(this IActionGroupsOperations operations, string notificationId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetTestNotificationsWithHttpMessagesAsync(notificationId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Send test notifications to a set of provided receivers
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='notificationRequest'>
 /// The notification request body which includes the contact details
 /// </param>
 public static TestNotificationResponse BeginPostTestNotifications(this IActionGroupsOperations operations, NotificationRequestBody notificationRequest)
 {
     return(operations.BeginPostTestNotificationsAsync(notificationRequest).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get the test notifications by the notification id
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='notificationId'>
 /// The notification id
 /// </param>
 public static TestNotificationDetailsResponse GetTestNotifications(this IActionGroupsOperations operations, string notificationId)
 {
     return(operations.GetTestNotificationsAsync(notificationId).GetAwaiter().GetResult());
 }
Пример #13
0
 /// <summary>
 /// Send test notifications to a set of provided receivers
 /// </summary>
 /// <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='actionGroupName'>
 /// The name of the action group.
 /// </param>
 /// <param name='notificationRequest'>
 /// The notification request body which includes the contact details
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders> BeginCreateNotificationsAtActionGroupResourceLevelAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateNotificationsAtActionGroupResourceLevelWithHttpMessagesAsync(resourceGroupName, actionGroupName, notificationRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Headers);
     }
 }
Пример #14
0
 /// <summary>
 /// Send test notifications to a set of provided receivers
 /// </summary>
 /// <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='actionGroupName'>
 /// The name of the action group.
 /// </param>
 /// <param name='notificationRequest'>
 /// The notification request body which includes the contact details
 /// </param>
 public static ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders BeginCreateNotificationsAtActionGroupResourceLevel(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, NotificationRequestBody notificationRequest)
 {
     return(operations.BeginCreateNotificationsAtActionGroupResourceLevelAsync(resourceGroupName, actionGroupName, notificationRequest).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>
 public static ActionGroupResource Get(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName)
 {
     return(operations.GetAsync(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>
 public static void Delete(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName)
 {
     operations.DeleteAsync(resourceGroupName, actionGroupName).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 <ActionGroupResourceInner> > ListBySubscriptionIdAsync(this IActionGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListBySubscriptionIdWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Updates an existing action group's tags. To update other fields use the
 /// CreateOrUpdate method.
 /// </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='actionGroupPatch'>
 /// Parameters supplied to the operation.
 /// </param>
 public static ActionGroupResource Update(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, ActionGroupPatchBody actionGroupPatch)
 {
     return(operations.UpdateAsync(resourceGroupName, actionGroupName, actionGroupPatch).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();
 }
Пример #20
0
 /// <summary>
 /// Send test notifications to a set of provided receivers
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='notificationRequest'>
 /// The notification request body which includes the contact details
 /// </param>
 public static ActionGroupsPostTestNotificationsHeaders PostTestNotifications(this IActionGroupsOperations operations, NotificationRequestBody notificationRequest)
 {
     return(operations.PostTestNotificationsAsync(notificationRequest).GetAwaiter().GetResult());
 }