From 4564a50032e966de555f5db0f2f47a2c250f0cf2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 23 Dec 2021 13:29:14 +0000 Subject: [PATCH] CodeGen from PR 17162 in Azure/azure-rest-api-specs Merge 80cf878f4f6bf704f8ed981b90b68f9151fb8651 into 698ebc782f3cc4650f6df1d765f6a38a6695ad50 --- .../ActionRulesOperationsExtensions.cs | 531 ------------------ ...s.cs => AlertProcessingRulesOperations.cs} | 455 +++++---------- ...lertProcessingRulesOperationsExtensions.cs | 327 +++++++++++ .../src/Generated/AlertsManagementClient.cs | 24 +- .../src/Generated/AlertsOperations.cs | 49 +- .../Generated/AlertsOperationsExtensions.cs | 4 +- .../src/Generated/IActionRulesOperations.cs | 322 ----------- .../IAlertProcessingRulesOperations.cs | 216 +++++++ .../src/Generated/IAlertsManagementClient.cs | 15 +- .../src/Generated/IAlertsOperations.cs | 4 +- .../src/Generated/IOperations.cs | 4 +- .../src/Generated/ISmartGroupsOperations.cs | 2 +- .../Models/{ScopeType.cs => Action.cs} | 22 +- .../src/Generated/Models/ActionGroup.cs | 82 --- .../Generated/Models/ActionRuleProperties.cs | 114 ---- .../src/Generated/Models/AddActionGroups.cs | 69 +++ .../{ActionRule.cs => AlertProcessingRule.cs} | 32 +- .../Models/AlertProcessingRuleProperties.cs | 124 ++++ ...rtProcessingRulesCreateOrUpdateHeaders.cs} | 16 +- ...s => AlertProcessingRulesDeleteHeaders.cs} | 12 +- ...> AlertProcessingRulesGetByNameHeaders.cs} | 12 +- ...cessingRulesListByResourceGroupHeaders.cs} | 10 +- ...rocessingRulesListBySubscriptionHeaders.cs | 53 ++ ...s => AlertProcessingRulesUpdateHeaders.cs} | 12 +- .../Generated/Models/AlertsSummaryGroup.cs | 6 +- .../Models/AlertsSummaryGroupItem.cs | 4 +- .../src/Generated/Models/Condition.cs | 23 +- .../src/Generated/Models/Conditions.cs | 106 ---- .../{ActionRuleStatus.cs => CreatedByType.cs} | 10 +- ...ateUpdateHeaders.cs => DailyRecurrence.cs} | 26 +- .../{SuppressionType.cs => DaysOfWeek.cs} | 16 +- .../src/Generated/Models/Diagnostics.cs | 58 -- .../src/Generated/Models/Field.cs | 31 + .../src/Generated/Models/ManagedResource.cs | 2 +- ...pressionConfig.cs => MonthlyRecurrence.cs} | 45 +- .../src/Generated/Models/PatchObject.cs | 26 +- .../src/Generated/Models/Recurrence.cs | 59 ++ .../Generated/Models/RemoveAllActionGroups.cs | 35 ++ .../src/Generated/Models/Schedule.cs | 105 ++++ .../src/Generated/Models/Scope.cs | 67 --- .../src/Generated/Models/SmartGroup.cs | 4 +- .../Models/SmartGroupAggregatedProperty.cs | 4 +- .../src/Generated/Models/Suppression.cs | 86 --- .../Generated/Models/SuppressionSchedule.cs | 86 --- .../src/Generated/Models/SystemData.cs | 103 ++++ .../src/Generated/Models/WeeklyRecurrence.cs | 72 +++ .../src/Generated/Operations.cs | 28 +- .../SdkInfo_AlertsManagementClient.cs | 13 +- .../src/Generated/SmartGroupsOperations.cs | 26 +- .../SmartGroupsOperationsExtensions.cs | 4 +- 50 files changed, 1565 insertions(+), 1991 deletions(-) delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ActionRulesOperationsExtensions.cs rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/{ActionRulesOperations.cs => AlertProcessingRulesOperations.cs} (78%) create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertProcessingRulesOperationsExtensions.cs delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IActionRulesOperations.cs create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertProcessingRulesOperations.cs rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ScopeType.cs => Action.cs} (51%) delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionGroup.cs delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRuleProperties.cs create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AddActionGroups.cs rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRule.cs => AlertProcessingRule.cs} (56%) create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRuleProperties.cs rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRulesGetByNameHeaders.cs => AlertProcessingRulesCreateOrUpdateHeaders.cs} (70%) rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRulesDeleteHeaders.cs => AlertProcessingRulesDeleteHeaders.cs} (75%) rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRulesListBySubscriptionHeaders.cs => AlertProcessingRulesGetByNameHeaders.cs} (79%) rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRulesListByResourceGroupHeaders.cs => AlertProcessingRulesListByResourceGroupHeaders.cs} (78%) create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRulesUpdateHeaders.cs => AlertProcessingRulesUpdateHeaders.cs} (75%) delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Conditions.cs rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRuleStatus.cs => CreatedByType.cs} (62%) rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{ActionRulesCreateUpdateHeaders.cs => DailyRecurrence.cs} (53%) rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{SuppressionType.cs => DaysOfWeek.cs} (52%) delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Diagnostics.cs create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Field.cs rename sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/{SuppressionConfig.cs => MonthlyRecurrence.cs} (50%) create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Recurrence.cs create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/RemoveAllActionGroups.cs create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Schedule.cs delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Scope.cs delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Suppression.cs delete mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionSchedule.cs create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SystemData.cs create mode 100644 sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/WeeklyRecurrence.cs diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ActionRulesOperationsExtensions.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ActionRulesOperationsExtensions.cs deleted file mode 100644 index 5ba0fc9fe021..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ActionRulesOperationsExtensions.cs +++ /dev/null @@ -1,531 +0,0 @@ -// -// 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.AlertsManagement -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ActionRulesOperations. - /// - public static partial class ActionRulesOperationsExtensions - { - /// - /// Get all action rule in a given subscription - /// - /// - /// List all action rules of the subscription and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for multiple - /// scopes). The value should be an well constructed ARM id of the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// - public static IPage ListBySubscription(this IActionRulesOperations operations, string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string)) - { - return operations.ListBySubscriptionAsync(targetResourceGroup, targetResourceType, targetResource, severity, monitorService, impactedScope, description, alertRuleId, actionGroup, name).GetAwaiter().GetResult(); - } - - /// - /// Get all action rule in a given subscription - /// - /// - /// List all action rules of the subscription and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for multiple - /// scopes). The value should be an well constructed ARM id of the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IActionRulesOperations operations, string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(targetResourceGroup, targetResourceType, targetResource, severity, monitorService, impactedScope, description, alertRuleId, actionGroup, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all action rules created in a resource group - /// - /// - /// List all action rules of the subscription, created in given resource group - /// and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for multiple - /// scopes). The value should be an well constructed ARM id of the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// - public static IPage ListByResourceGroup(this IActionRulesOperations operations, string resourceGroupName, string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string)) - { - return operations.ListByResourceGroupAsync(resourceGroupName, targetResourceGroup, targetResourceType, targetResource, severity, monitorService, impactedScope, description, alertRuleId, actionGroup, name).GetAwaiter().GetResult(); - } - - /// - /// Get all action rules created in a resource group - /// - /// - /// List all action rules of the subscription, created in given resource group - /// and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for multiple - /// scopes). The value should be an well constructed ARM id of the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IActionRulesOperations operations, string resourceGroupName, string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, targetResourceGroup, targetResourceType, targetResource, severity, monitorService, impactedScope, description, alertRuleId, actionGroup, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get action rule by name - /// - /// - /// Get a specific action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of action rule that needs to be fetched - /// - public static ActionRule GetByName(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName) - { - return operations.GetByNameAsync(resourceGroupName, actionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Get action rule by name - /// - /// - /// Get a specific action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of action rule that needs to be fetched - /// - /// - /// The cancellation token. - /// - public static async Task GetByNameAsync(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, actionRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create/update an action rule - /// - /// - /// Creates/Updates a specific action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of action rule that needs to be created/updated - /// - /// - /// action rule to be created/updated - /// - public static ActionRule CreateUpdate(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName, ActionRule actionRule) - { - return operations.CreateUpdateAsync(resourceGroupName, actionRuleName, actionRule).GetAwaiter().GetResult(); - } - - /// - /// Create/update an action rule - /// - /// - /// Creates/Updates a specific action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of action rule that needs to be created/updated - /// - /// - /// action rule to be created/updated - /// - /// - /// The cancellation token. - /// - public static async Task CreateUpdateAsync(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName, ActionRule actionRule, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateUpdateWithHttpMessagesAsync(resourceGroupName, actionRuleName, actionRule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete action rule - /// - /// - /// Deletes a given action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be deleted - /// - public static bool? Delete(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName) - { - return operations.DeleteAsync(resourceGroupName, actionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Delete action rule - /// - /// - /// Deletes a given action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be deleted - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, actionRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Patch action rule - /// - /// - /// Update enabled flag and/or tags for the given action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be updated - /// - /// - /// Parameters supplied to the operation. - /// - public static ActionRule Update(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName, PatchObject actionRulePatch) - { - return operations.UpdateAsync(resourceGroupName, actionRuleName, actionRulePatch).GetAwaiter().GetResult(); - } - - /// - /// Patch action rule - /// - /// - /// Update enabled flag and/or tags for the given action rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be updated - /// - /// - /// Parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IActionRulesOperations operations, string resourceGroupName, string actionRuleName, PatchObject actionRulePatch, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, actionRuleName, actionRulePatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all action rule in a given subscription - /// - /// - /// List all action rules of the subscription and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IActionRulesOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all action rule in a given subscription - /// - /// - /// List all action rules of the subscription and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IActionRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all action rules created in a resource group - /// - /// - /// List all action rules of the subscription, created in given resource group - /// and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IActionRulesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all action rules created in a resource group - /// - /// - /// List all action rules of the subscription, created in given resource group - /// and given input filters - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IActionRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ActionRulesOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertProcessingRulesOperations.cs similarity index 78% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ActionRulesOperations.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertProcessingRulesOperations.cs index ddb7be193992..7a2e11b02e94 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ActionRulesOperations.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertProcessingRulesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.AlertsManagement using System.Threading.Tasks; /// - /// ActionRulesOperations operations. + /// AlertProcessingRulesOperations operations. /// - internal partial class ActionRulesOperations : IServiceOperations, IActionRulesOperations + internal partial class AlertProcessingRulesOperations : IServiceOperations, IAlertProcessingRulesOperations { /// - /// Initializes a new instance of the ActionRulesOperations class. + /// Initializes a new instance of the AlertProcessingRulesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class ActionRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ActionRulesOperations(AlertsManagementClient client) + internal AlertProcessingRulesOperations(AlertsManagementClient client) { if (client == null) { @@ -51,49 +51,8 @@ internal ActionRulesOperations(AlertsManagementClient client) public AlertsManagementClient Client { get; private set; } /// - /// Get all action rule in a given subscription + /// List all alert processing rules in a subscription. /// - /// - /// List all action rules of the subscription and given input filters - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for multiple - /// scopes). The value should be an well constructed ARM id of the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// /// /// Headers that will be added to request. /// @@ -115,7 +74,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,ActionRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -128,6 +87,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2021-08-08"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -135,16 +95,7 @@ internal ActionRulesOperations(AlertsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("targetResourceGroup", targetResourceGroup); - tracingParameters.Add("targetResourceType", targetResourceType); - tracingParameters.Add("targetResource", targetResource); - tracingParameters.Add("severity", severity); - tracingParameters.Add("monitorService", monitorService); - tracingParameters.Add("impactedScope", impactedScope); - tracingParameters.Add("description", description); - tracingParameters.Add("alertRuleId", alertRuleId); - tracingParameters.Add("actionGroup", actionGroup); - tracingParameters.Add("name", name); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } @@ -153,49 +104,9 @@ internal ActionRulesOperations(AlertsManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/actionRules").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (targetResourceGroup != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("targetResourceGroup={0}", System.Uri.EscapeDataString(targetResourceGroup))); - } - if (targetResourceType != null) - { - _queryParameters.Add(string.Format("targetResourceType={0}", System.Uri.EscapeDataString(targetResourceType))); - } - if (targetResource != null) - { - _queryParameters.Add(string.Format("targetResource={0}", System.Uri.EscapeDataString(targetResource))); - } - if (severity != null) - { - _queryParameters.Add(string.Format("severity={0}", System.Uri.EscapeDataString(severity))); - } - if (monitorService != null) - { - _queryParameters.Add(string.Format("monitorService={0}", System.Uri.EscapeDataString(monitorService))); - } - if (impactedScope != null) - { - _queryParameters.Add(string.Format("impactedScope={0}", System.Uri.EscapeDataString(impactedScope))); - } - if (description != null) - { - _queryParameters.Add(string.Format("description={0}", System.Uri.EscapeDataString(description))); - } - if (alertRuleId != null) - { - _queryParameters.Add(string.Format("alertRuleId={0}", System.Uri.EscapeDataString(alertRuleId))); - } - if (actionGroup != null) - { - _queryParameters.Add(string.Format("actionGroup={0}", System.Uri.EscapeDataString(actionGroup))); - } - if (name != null) - { - _queryParameters.Add(string.Format("name={0}", System.Uri.EscapeDataString(name))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -285,7 +196,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,ActionRulesListBySubscriptionHeaders>(); + var _result = new AzureOperationResponse,AlertProcessingRulesListBySubscriptionHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -298,7 +209,7 @@ internal ActionRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -312,7 +223,7 @@ internal ActionRulesOperations(AlertsManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -331,53 +242,11 @@ internal ActionRulesOperations(AlertsManagementClient client) } /// - /// Get all action rules created in a resource group + /// List all alert processing rules in a resource group. /// - /// - /// List all action rules of the subscription, created in given resource group - /// and given input filters - /// /// /// Resource group name where the resource is created. /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for multiple - /// scopes). The value should be an well constructed ARM id of the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// /// /// Headers that will be added to request. /// @@ -399,7 +268,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,ActionRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -416,6 +285,7 @@ internal ActionRulesOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2021-08-08"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -424,16 +294,7 @@ internal ActionRulesOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("targetResourceGroup", targetResourceGroup); - tracingParameters.Add("targetResourceType", targetResourceType); - tracingParameters.Add("targetResource", targetResource); - tracingParameters.Add("severity", severity); - tracingParameters.Add("monitorService", monitorService); - tracingParameters.Add("impactedScope", impactedScope); - tracingParameters.Add("description", description); - tracingParameters.Add("alertRuleId", alertRuleId); - tracingParameters.Add("actionGroup", actionGroup); - tracingParameters.Add("name", name); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -443,49 +304,9 @@ internal ActionRulesOperations(AlertsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); - if (targetResourceGroup != null) - { - _queryParameters.Add(string.Format("targetResourceGroup={0}", System.Uri.EscapeDataString(targetResourceGroup))); - } - if (targetResourceType != null) - { - _queryParameters.Add(string.Format("targetResourceType={0}", System.Uri.EscapeDataString(targetResourceType))); - } - if (targetResource != null) - { - _queryParameters.Add(string.Format("targetResource={0}", System.Uri.EscapeDataString(targetResource))); - } - if (severity != null) - { - _queryParameters.Add(string.Format("severity={0}", System.Uri.EscapeDataString(severity))); - } - if (monitorService != null) - { - _queryParameters.Add(string.Format("monitorService={0}", System.Uri.EscapeDataString(monitorService))); - } - if (impactedScope != null) - { - _queryParameters.Add(string.Format("impactedScope={0}", System.Uri.EscapeDataString(impactedScope))); - } - if (description != null) - { - _queryParameters.Add(string.Format("description={0}", System.Uri.EscapeDataString(description))); - } - if (alertRuleId != null) - { - _queryParameters.Add(string.Format("alertRuleId={0}", System.Uri.EscapeDataString(alertRuleId))); - } - if (actionGroup != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("actionGroup={0}", System.Uri.EscapeDataString(actionGroup))); - } - if (name != null) - { - _queryParameters.Add(string.Format("name={0}", System.Uri.EscapeDataString(name))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -575,7 +396,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,ActionRulesListByResourceGroupHeaders>(); + var _result = new AzureOperationResponse,AlertProcessingRulesListByResourceGroupHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -588,7 +409,7 @@ internal ActionRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -602,7 +423,7 @@ internal ActionRulesOperations(AlertsManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -621,16 +442,13 @@ internal ActionRulesOperations(AlertsManagementClient client) } /// - /// Get action rule by name + /// Get an alert processing rule by name. /// - /// - /// Get a specific action rule - /// /// /// Resource group name where the resource is created. /// - /// - /// The name of action rule that needs to be fetched + /// + /// The name of the alert processing rule that needs to be fetched. /// /// /// Headers that will be added to request. @@ -653,7 +471,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -670,10 +488,11 @@ internal ActionRulesOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (actionRuleName == null) + if (alertProcessingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "actionRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); } + string apiVersion = "2021-08-08"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -682,20 +501,21 @@ internal ActionRulesOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("actionRuleName", actionRuleName); + tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetByName", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{actionRuleName}", System.Uri.EscapeDataString(actionRuleName)); + _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -785,7 +605,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -798,7 +618,7 @@ internal ActionRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -812,7 +632,7 @@ internal ActionRulesOperations(AlertsManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -831,19 +651,16 @@ internal ActionRulesOperations(AlertsManagementClient client) } /// - /// Create/update an action rule + /// Create or update an alert processing rule. /// - /// - /// Creates/Updates a specific action rule - /// /// /// Resource group name where the resource is created. /// - /// - /// The name of action rule that needs to be created/updated + /// + /// The name of the alert processing rule that needs to be created/updated. /// - /// - /// action rule to be created/updated + /// + /// Alert processing rule to be created/updated. /// /// /// Headers that will be added to request. @@ -866,7 +683,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, ActionRule actionRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -883,18 +700,19 @@ internal ActionRulesOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (actionRuleName == null) + if (alertProcessingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "actionRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); } - if (actionRule == null) + if (alertProcessingRule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "actionRule"); + throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRule"); } - if (actionRule != null) + if (alertProcessingRule != null) { - actionRule.Validate(); + alertProcessingRule.Validate(); } + string apiVersion = "2021-08-08"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -903,21 +721,22 @@ internal ActionRulesOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("actionRuleName", actionRuleName); - tracingParameters.Add("actionRule", actionRule); + tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); + tracingParameters.Add("alertProcessingRule", alertProcessingRule); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{actionRuleName}", System.Uri.EscapeDataString(actionRuleName)); + _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -957,9 +776,9 @@ internal ActionRulesOperations(AlertsManagementClient client) // Serialize Request string _requestContent = null; - if(actionRule != null) + if(alertProcessingRule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(actionRule, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(alertProcessingRule, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -983,7 +802,7 @@ internal ActionRulesOperations(AlertsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1013,7 +832,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1026,7 +845,25 @@ internal ActionRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1040,7 +877,7 @@ internal ActionRulesOperations(AlertsManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -1059,16 +896,13 @@ internal ActionRulesOperations(AlertsManagementClient client) } /// - /// Delete action rule + /// Delete an alert processing rule. /// - /// - /// Deletes a given action rule - /// /// /// Resource group name where the resource is created. /// - /// - /// The name that needs to be deleted + /// + /// The name of the alert processing rule that needs to be deleted. /// /// /// Headers that will be added to request. @@ -1079,9 +913,6 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1091,7 +922,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1108,10 +939,11 @@ internal ActionRulesOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (actionRuleName == null) + if (alertProcessingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "actionRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); } + string apiVersion = "2021-08-08"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1120,20 +952,21 @@ internal ActionRulesOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("actionRuleName", actionRuleName); + tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{actionRuleName}", System.Uri.EscapeDataString(actionRuleName)); + _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1193,7 +1026,7 @@ internal ActionRulesOperations(AlertsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1223,34 +1056,16 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -1269,18 +1084,15 @@ internal ActionRulesOperations(AlertsManagementClient client) } /// - /// Patch action rule + /// Enable, disable, or update tags for an alert processing rule. /// - /// - /// Update enabled flag and/or tags for the given action rule - /// /// /// Resource group name where the resource is created. /// - /// - /// The name that needs to be updated + /// + /// The name that needs to be updated. /// - /// + /// /// Parameters supplied to the operation. /// /// @@ -1304,7 +1116,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, PatchObject actionRulePatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1321,14 +1133,15 @@ internal ActionRulesOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (actionRuleName == null) + if (alertProcessingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "actionRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); } - if (actionRulePatch == null) + if (alertProcessingRulePatch == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "actionRulePatch"); + throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRulePatch"); } + string apiVersion = "2021-08-08"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1337,21 +1150,22 @@ internal ActionRulesOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("actionRuleName", actionRuleName); - tracingParameters.Add("actionRulePatch", actionRulePatch); + tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); + tracingParameters.Add("alertProcessingRulePatch", alertProcessingRulePatch); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{actionRuleName}", System.Uri.EscapeDataString(actionRuleName)); + _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1391,9 +1205,9 @@ internal ActionRulesOperations(AlertsManagementClient client) // Serialize Request string _requestContent = null; - if(actionRulePatch != null) + if(alertProcessingRulePatch != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(actionRulePatch, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(alertProcessingRulePatch, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -1447,7 +1261,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1460,7 +1274,7 @@ internal ActionRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1474,7 +1288,7 @@ internal ActionRulesOperations(AlertsManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -1493,11 +1307,8 @@ internal ActionRulesOperations(AlertsManagementClient client) } /// - /// Get all action rule in a given subscription + /// List all alert processing rules in a subscription. /// - /// - /// List all action rules of the subscription and given input filters - /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1522,7 +1333,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,ActionRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1631,7 +1442,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,ActionRulesListBySubscriptionHeaders>(); + var _result = new AzureOperationResponse,AlertProcessingRulesListBySubscriptionHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1644,7 +1455,7 @@ internal ActionRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1658,7 +1469,7 @@ internal ActionRulesOperations(AlertsManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -1677,12 +1488,8 @@ internal ActionRulesOperations(AlertsManagementClient client) } /// - /// Get all action rules created in a resource group + /// List all alert processing rules in a resource group. /// - /// - /// List all action rules of the subscription, created in given resource group - /// and given input filters - /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1707,7 +1514,7 @@ internal ActionRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,ActionRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1816,7 +1623,7 @@ internal ActionRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,ActionRulesListByResourceGroupHeaders>(); + var _result = new AzureOperationResponse,AlertProcessingRulesListByResourceGroupHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1829,7 +1636,7 @@ internal ActionRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1843,7 +1650,7 @@ internal ActionRulesOperations(AlertsManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertProcessingRulesOperationsExtensions.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertProcessingRulesOperationsExtensions.cs new file mode 100644 index 000000000000..08854f4e5149 --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertProcessingRulesOperationsExtensions.cs @@ -0,0 +1,327 @@ +// +// 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.AlertsManagement +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AlertProcessingRulesOperations. + /// + public static partial class AlertProcessingRulesOperationsExtensions + { + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this IAlertProcessingRulesOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IAlertProcessingRulesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + public static IPage ListByResourceGroup(this IAlertProcessingRulesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get an alert processing rule by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be fetched. + /// + public static AlertProcessingRule GetByName(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName) + { + return operations.GetByNameAsync(resourceGroupName, alertProcessingRuleName).GetAwaiter().GetResult(); + } + + /// + /// Get an alert processing rule by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetByNameAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be created/updated. + /// + /// + /// Alert processing rule to be created/updated. + /// + public static AlertProcessingRule CreateOrUpdate(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule) + { + return operations.CreateOrUpdateAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRule).GetAwaiter().GetResult(); + } + + /// + /// Create or update an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be created/updated. + /// + /// + /// Alert processing rule to be created/updated. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRule, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be deleted. + /// + public static AlertProcessingRulesDeleteHeaders Delete(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName) + { + return operations.DeleteAsync(resourceGroupName, alertProcessingRuleName).GetAwaiter().GetResult(); + } + + /// + /// Delete an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Enable, disable, or update tags for an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name that needs to be updated. + /// + /// + /// Parameters supplied to the operation. + /// + public static AlertProcessingRule Update(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch) + { + return operations.UpdateAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRulePatch).GetAwaiter().GetResult(); + } + + /// + /// Enable, disable, or update tags for an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name that needs to be updated. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRulePatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IAlertProcessingRulesOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IAlertProcessingRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IAlertProcessingRulesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IAlertProcessingRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsManagementClient.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsManagementClient.cs index 5c4803a630fb..0b357bdb9dbf 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsManagementClient.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsManagementClient.cs @@ -51,11 +51,6 @@ public partial class AlertsManagementClient : ServiceClient public string SubscriptionId { get; set; } - /// - /// client API version - /// - public string ApiVersion { get; private set; } - /// /// The preferred language for the response. /// @@ -74,6 +69,11 @@ public partial class AlertsManagementClient : ServiceClient public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IAlertProcessingRulesOperations. + /// + public virtual IAlertProcessingRulesOperations AlertProcessingRules { get; private set; } + /// /// Gets the IOperations. /// @@ -89,11 +89,6 @@ public partial class AlertsManagementClient : ServiceClient public virtual ISmartGroupsOperations SmartGroups { get; private set; } - /// - /// Gets the IActionRulesOperations. - /// - public virtual IActionRulesOperations ActionRules { get; private set; } - /// /// Initializes a new instance of the AlertsManagementClient class. /// @@ -335,12 +330,11 @@ public AlertsManagementClient(System.Uri baseUri, ServiceClientCredentials crede /// private void Initialize() { + AlertProcessingRules = new AlertProcessingRulesOperations(this); Operations = new Operations(this); Alerts = new AlertsOperations(this); SmartGroups = new SmartGroupsOperations(this); - ActionRules = new ActionRulesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-05-05-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -370,8 +364,10 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("recurrenceType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("recurrenceType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("actionType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("actionType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("metadataIdentifier")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("metadataIdentifier")); CustomInitialize(); diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperations.cs index 74d405140c09..2e2112ecffde 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperations.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperations.cs @@ -59,7 +59,7 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,6 +70,7 @@ internal AlertsOperations(AlertsManagementClient client) /// public async Task> MetaDataWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + string apiVersion = "2019-05-05-preview"; string identifier = "MonitorServiceList"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -78,6 +79,7 @@ internal AlertsOperations(AlertsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("identifier", identifier); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "MetaData", tracingParameters); @@ -86,9 +88,9 @@ internal AlertsOperations(AlertsManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.AlertsManagement/alertsMetaData").ToString(); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (identifier != null) { @@ -154,14 +156,13 @@ internal AlertsOperations(AlertsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -171,10 +172,6 @@ internal AlertsOperations(AlertsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -322,7 +319,7 @@ internal AlertsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -335,6 +332,7 @@ internal AlertsOperations(AlertsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -359,6 +357,7 @@ internal AlertsOperations(AlertsManagementClient client) tracingParameters.Add("select", select); tracingParameters.Add("timeRange", timeRange); tracingParameters.Add("customTimeRange", customTimeRange); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetAll", tracingParameters); } @@ -435,9 +434,9 @@ internal AlertsOperations(AlertsManagementClient client) { _queryParameters.Add(string.Format("customTimeRange={0}", System.Uri.EscapeDataString(customTimeRange))); } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -606,6 +605,7 @@ internal AlertsOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "alertId"); } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -614,6 +614,7 @@ internal AlertsOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("alertId", alertId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); } @@ -623,9 +624,9 @@ internal AlertsOperations(AlertsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{alertId}", System.Uri.EscapeDataString(alertId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -799,6 +800,7 @@ internal AlertsOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "newState"); } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -807,6 +809,7 @@ internal AlertsOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("alertId", alertId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("newState", newState); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ChangeState", tracingParameters); @@ -817,9 +820,9 @@ internal AlertsOperations(AlertsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{alertId}", System.Uri.EscapeDataString(alertId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (newState != null) { @@ -990,6 +993,7 @@ internal AlertsOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "alertId"); } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -998,6 +1002,7 @@ internal AlertsOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("alertId", alertId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetHistory", tracingParameters); } @@ -1007,9 +1012,9 @@ internal AlertsOperations(AlertsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{alertId}", System.Uri.EscapeDataString(alertId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1227,6 +1232,7 @@ internal AlertsOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "groupby"); } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1246,6 +1252,7 @@ internal AlertsOperations(AlertsManagementClient client) tracingParameters.Add("alertRule", alertRule); tracingParameters.Add("timeRange", timeRange); tracingParameters.Add("customTimeRange", customTimeRange); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSummary", tracingParameters); } @@ -1302,9 +1309,9 @@ internal AlertsOperations(AlertsManagementClient client) { _queryParameters.Add(string.Format("customTimeRange={0}", System.Uri.EscapeDataString(customTimeRange))); } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperationsExtensions.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperationsExtensions.cs index e1f6ec2ea219..12d2945e138a 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperationsExtensions.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/AlertsOperationsExtensions.cs @@ -134,7 +134,7 @@ public static AlertsMetaData MetaData(this IAlertsOperations operations) /// Permissible values is within 30 days from query time. Either timeRange or /// customTimeRange could be used but not both. Default is none. /// - public static IPage GetAll(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string)) + public static IPage GetAll(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string)) { return operations.GetAllAsync(targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, smartGroupId, includeContext, includeEgressConfig, pageCount, sortBy, sortOrder, select, timeRange, customTimeRange).GetAwaiter().GetResult(); } @@ -227,7 +227,7 @@ public static AlertsMetaData MetaData(this IAlertsOperations operations) /// /// The cancellation token. /// - public static async Task> GetAllAsync(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetAllAsync(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, smartGroupId, includeContext, includeEgressConfig, pageCount, sortBy, sortOrder, select, timeRange, customTimeRange, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IActionRulesOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IActionRulesOperations.cs deleted file mode 100644 index a88b2bffc2e6..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IActionRulesOperations.cs +++ /dev/null @@ -1,322 +0,0 @@ -// -// 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.AlertsManagement -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// ActionRulesOperations operations. - /// - public partial interface IActionRulesOperations - { - /// - /// Get all action rule in a given subscription - /// - /// - /// List all action rules of the subscription and given input filters - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is - /// select all. - /// - /// - /// Filter by severity. Default value is select all. Possible values - /// include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. - /// Default value is select all. Possible values include: 'Application - /// Insights', 'ActivityLog Administrative', 'ActivityLog Security', - /// 'ActivityLog Recommendation', 'ActivityLog Policy', 'ActivityLog - /// Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM', - /// 'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for - /// multiple scopes). The value should be an well constructed ARM id of - /// the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task,ActionRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get all action rules created in a resource group - /// - /// - /// List all action rules of the subscription, created in given - /// resource group and given input filters - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is - /// select all. - /// - /// - /// Filter by severity. Default value is select all. Possible values - /// include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by monitor service which generates the alert instance. - /// Default value is select all. Possible values include: 'Application - /// Insights', 'ActivityLog Administrative', 'ActivityLog Security', - /// 'ActivityLog Recommendation', 'ActivityLog Policy', 'ActivityLog - /// Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM', - /// 'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix' - /// - /// - /// filter by impacted/target scope (provide comma separated list for - /// multiple scopes). The value should be an well constructed ARM id of - /// the scope. - /// - /// - /// filter by alert rule description - /// - /// - /// filter by alert rule id - /// - /// - /// filter by action group configured as part of action rule - /// - /// - /// filter by action rule name - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task,ActionRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string targetResourceGroup = default(string), string targetResourceType = default(string), string targetResource = default(string), string severity = default(string), string monitorService = default(string), string impactedScope = default(string), string description = default(string), string alertRuleId = default(string), string actionGroup = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get action rule by name - /// - /// - /// Get a specific action rule - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of action rule that needs to be fetched - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Create/update an action rule - /// - /// - /// Creates/Updates a specific action rule - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of action rule that needs to be created/updated - /// - /// - /// action rule to be created/updated - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, ActionRule actionRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete action rule - /// - /// - /// Deletes a given action rule - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be deleted - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Patch action rule - /// - /// - /// Update enabled flag and/or tags for the given action rule - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be updated - /// - /// - /// Parameters supplied to the operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string actionRuleName, PatchObject actionRulePatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get all action rule in a given subscription - /// - /// - /// List all action rules of the subscription and given input filters - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task,ActionRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get all action rules created in a resource group - /// - /// - /// List all action rules of the subscription, created in given - /// resource group and given input filters - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task,ActionRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertProcessingRulesOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertProcessingRulesOperations.cs new file mode 100644 index 000000000000..90853829feca --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertProcessingRulesOperations.cs @@ -0,0 +1,216 @@ +// +// 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.AlertsManagement +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AlertProcessingRulesOperations operations. + /// + public partial interface IAlertProcessingRulesOperations + { + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all alert processing rules in a resource group. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get an alert processing rule by name. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update an alert processing rule. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be + /// created/updated. + /// + /// + /// Alert processing rule to be created/updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete an alert processing rule. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enable, disable, or update tags for an alert processing rule. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name that needs to be updated. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsManagementClient.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsManagementClient.cs index 5983738e9d70..98630aec841c 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsManagementClient.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsManagementClient.cs @@ -45,11 +45,6 @@ public partial interface IAlertsManagementClient : System.IDisposable /// string SubscriptionId { get; set; } - /// - /// client API version - /// - string ApiVersion { get; } - /// /// The preferred language for the response. /// @@ -69,6 +64,11 @@ public partial interface IAlertsManagementClient : System.IDisposable bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IAlertProcessingRulesOperations. + /// + IAlertProcessingRulesOperations AlertProcessingRules { get; } + /// /// Gets the IOperations. /// @@ -84,10 +84,5 @@ public partial interface IAlertsManagementClient : System.IDisposable /// ISmartGroupsOperations SmartGroups { get; } - /// - /// Gets the IActionRulesOperations. - /// - IActionRulesOperations ActionRules { get; } - } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsOperations.cs index 32a11491ad02..144424dcb6e0 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsOperations.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IAlertsOperations.cs @@ -33,7 +33,7 @@ public partial interface IAlertsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -146,7 +146,7 @@ public partial interface IAlertsOperations /// /// Thrown when a required parameter is null /// - Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get a specific alert. /// diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IOperations.cs index 750d98bef148..687bb483e83f 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IOperations.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/IOperations.cs @@ -33,7 +33,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -56,7 +56,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ISmartGroupsOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ISmartGroupsOperations.cs index f17758aa28b6..742317f9df52 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ISmartGroupsOperations.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/ISmartGroupsOperations.cs @@ -95,7 +95,7 @@ public partial interface ISmartGroupsOperations /// /// Thrown when a required parameter is null /// - Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get information related to a specific Smart Group. /// diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ScopeType.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Action.cs similarity index 51% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ScopeType.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Action.cs index 22a3e4d1f738..d5394bdbf341 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ScopeType.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Action.cs @@ -10,14 +10,26 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models { + using System.Linq; /// - /// Defines values for ScopeType. + /// Action to be applied. /// - public static class ScopeType + public partial class Action { - public const string ResourceGroup = "ResourceGroup"; - public const string Resource = "Resource"; - public const string Subscription = "Subscription"; + /// + /// Initializes a new instance of the Action class. + /// + public Action() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionGroup.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionGroup.cs deleted file mode 100644 index 57f9b62a8dc0..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionGroup.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// 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.AlertsManagement.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Action Group based Action Rule - /// - /// - /// Action rule with action group configuration - /// - public partial class ActionGroup : ActionRuleProperties - { - /// - /// Initializes a new instance of the ActionGroup class. - /// - public ActionGroup() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActionGroup class. - /// - /// Action group to trigger if action rule - /// matches - /// scope on which action rule will apply - /// conditions on which alerts will be - /// filtered - /// Description of action rule - /// Creation time of action rule. Date-Time in - /// ISO-8601 format. - /// Last updated time of action rule. - /// Date-Time in ISO-8601 format. - /// Created by user name. - /// Last modified by user name. - /// Indicates if the given action rule is enabled - /// or disabled. Possible values include: 'Enabled', 'Disabled' - public ActionGroup(string actionGroupId, Scope scope = default(Scope), Conditions conditions = default(Conditions), string description = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? lastModifiedAt = default(System.DateTime?), string createdBy = default(string), string lastModifiedBy = default(string), string status = default(string)) - : base(scope, conditions, description, createdAt, lastModifiedAt, createdBy, lastModifiedBy, status) - { - ActionGroupId = actionGroupId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets action group to trigger if action rule matches - /// - [JsonProperty(PropertyName = "actionGroupId")] - public string ActionGroupId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ActionGroupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ActionGroupId"); - } - } - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRuleProperties.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRuleProperties.cs deleted file mode 100644 index 4fd27d6a40c6..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRuleProperties.cs +++ /dev/null @@ -1,114 +0,0 @@ -// -// 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.AlertsManagement.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Action rule properties defining scope, conditions, suppression logic - /// for action rule - /// - public partial class ActionRuleProperties - { - /// - /// Initializes a new instance of the ActionRuleProperties class. - /// - public ActionRuleProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActionRuleProperties class. - /// - /// scope on which action rule will apply - /// conditions on which alerts will be - /// filtered - /// Description of action rule - /// Creation time of action rule. Date-Time in - /// ISO-8601 format. - /// Last updated time of action rule. - /// Date-Time in ISO-8601 format. - /// Created by user name. - /// Last modified by user name. - /// Indicates if the given action rule is enabled - /// or disabled. Possible values include: 'Enabled', 'Disabled' - public ActionRuleProperties(Scope scope = default(Scope), Conditions conditions = default(Conditions), string description = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? lastModifiedAt = default(System.DateTime?), string createdBy = default(string), string lastModifiedBy = default(string), string status = default(string)) - { - Scope = scope; - Conditions = conditions; - Description = description; - CreatedAt = createdAt; - LastModifiedAt = lastModifiedAt; - CreatedBy = createdBy; - LastModifiedBy = lastModifiedBy; - Status = status; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets scope on which action rule will apply - /// - [JsonProperty(PropertyName = "scope")] - public Scope Scope { get; set; } - - /// - /// Gets or sets conditions on which alerts will be filtered - /// - [JsonProperty(PropertyName = "conditions")] - public Conditions Conditions { get; set; } - - /// - /// Gets or sets description of action rule - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets creation time of action rule. Date-Time in ISO-8601 format. - /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; private set; } - - /// - /// Gets last updated time of action rule. Date-Time in ISO-8601 - /// format. - /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; private set; } - - /// - /// Gets created by user name. - /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; private set; } - - /// - /// Gets last modified by user name. - /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; private set; } - - /// - /// Gets or sets indicates if the given action rule is enabled or - /// disabled. Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AddActionGroups.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AddActionGroups.cs new file mode 100644 index 000000000000..02777b64b964 --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AddActionGroups.cs @@ -0,0 +1,69 @@ +// +// 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.AlertsManagement.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Add action groups to alert processing rule. + /// + public partial class AddActionGroups : Action + { + /// + /// Initializes a new instance of the AddActionGroups class. + /// + public AddActionGroups() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddActionGroups class. + /// + /// List of action group Ids to add to + /// alert processing rule. + public AddActionGroups(IList actionGroupIds) + { + ActionGroupIds = actionGroupIds; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of action group Ids to add to alert processing + /// rule. + /// + [JsonProperty(PropertyName = "actionGroupIds")] + public IList ActionGroupIds { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ActionGroupIds == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ActionGroupIds"); + } + } + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRule.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRule.cs similarity index 56% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRule.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRule.cs index 3a6a49404203..d9b1220a6a60 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRule.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRule.cs @@ -16,32 +16,34 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models using System.Linq; /// - /// Action rule object containing target scope, conditions and suppression - /// logic + /// Alert processing rule object containing target scopes, conditions and + /// scheduling logic. /// - public partial class ActionRule : ManagedResource + public partial class AlertProcessingRule : ManagedResource { /// - /// Initializes a new instance of the ActionRule class. + /// Initializes a new instance of the AlertProcessingRule class. /// - public ActionRule() + public AlertProcessingRule() { CustomInit(); } /// - /// Initializes a new instance of the ActionRule class. + /// Initializes a new instance of the AlertProcessingRule class. /// /// Resource location /// Azure resource Id /// Azure resource type /// Azure resource name /// Resource tags - /// action rule properties - public ActionRule(string location, string id = default(string), string type = default(string), string name = default(string), IDictionary tags = default(IDictionary), ActionRuleProperties properties = default(ActionRuleProperties)) + /// Alert processing rule properties. + /// Alert processing rule system data. + public AlertProcessingRule(string location, string id = default(string), string type = default(string), string name = default(string), IDictionary tags = default(IDictionary), AlertProcessingRuleProperties properties = default(AlertProcessingRuleProperties), SystemData systemData = default(SystemData)) : base(location, id, type, name, tags) { Properties = properties; + SystemData = systemData; CustomInit(); } @@ -51,10 +53,16 @@ public ActionRule() partial void CustomInit(); /// - /// Gets or sets action rule properties + /// Gets or sets alert processing rule properties. /// [JsonProperty(PropertyName = "properties")] - public ActionRuleProperties Properties { get; set; } + public AlertProcessingRuleProperties Properties { get; set; } + + /// + /// Gets or sets alert processing rule system data. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; set; } /// /// Validate the object. @@ -65,6 +73,10 @@ public ActionRule() public override void Validate() { base.Validate(); + if (Properties != null) + { + Properties.Validate(); + } } } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRuleProperties.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRuleProperties.cs new file mode 100644 index 000000000000..b7df1748ca80 --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRuleProperties.cs @@ -0,0 +1,124 @@ +// +// 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.AlertsManagement.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Alert processing rule properties defining scopes, conditions and + /// scheduling logic for alert processing rule. + /// + public partial class AlertProcessingRuleProperties + { + /// + /// Initializes a new instance of the AlertProcessingRuleProperties + /// class. + /// + public AlertProcessingRuleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlertProcessingRuleProperties + /// class. + /// + /// Scopes on which alert processing rule will + /// apply. + /// Actions to be applied. + /// Conditions on which alerts will be + /// filtered. + /// Scheduling for alert processing + /// rule. + /// Description of alert processing + /// rule. + /// Indicates if the given alert processing rule + /// is enabled or disabled. + public AlertProcessingRuleProperties(IList scopes, IList actions, IList conditions = default(IList), Schedule schedule = default(Schedule), string description = default(string), bool? enabled = default(bool?)) + { + Scopes = scopes; + Conditions = conditions; + Schedule = schedule; + Actions = actions; + Description = description; + Enabled = enabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets scopes on which alert processing rule will apply. + /// + [JsonProperty(PropertyName = "scopes")] + public IList Scopes { get; set; } + + /// + /// Gets or sets conditions on which alerts will be filtered. + /// + [JsonProperty(PropertyName = "conditions")] + public IList Conditions { get; set; } + + /// + /// Gets or sets scheduling for alert processing rule. + /// + [JsonProperty(PropertyName = "schedule")] + public Schedule Schedule { get; set; } + + /// + /// Gets or sets actions to be applied. + /// + [JsonProperty(PropertyName = "actions")] + public IList Actions { get; set; } + + /// + /// Gets or sets description of alert processing rule. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets indicates if the given alert processing rule is + /// enabled or disabled. + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Scopes == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Scopes"); + } + if (Actions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Actions"); + } + if (Schedule != null) + { + Schedule.Validate(); + } + } + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesGetByNameHeaders.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesCreateOrUpdateHeaders.cs similarity index 70% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesGetByNameHeaders.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesCreateOrUpdateHeaders.cs index fc8bab08ce0f..0400450e8e84 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesGetByNameHeaders.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesCreateOrUpdateHeaders.cs @@ -14,25 +14,25 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models using System.Linq; /// - /// Defines headers for GetByName operation. + /// Defines headers for CreateOrUpdate operation. /// - public partial class ActionRulesGetByNameHeaders + public partial class AlertProcessingRulesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the ActionRulesGetByNameHeaders - /// class. + /// Initializes a new instance of the + /// AlertProcessingRulesCreateOrUpdateHeaders class. /// - public ActionRulesGetByNameHeaders() + public AlertProcessingRulesCreateOrUpdateHeaders() { CustomInit(); } /// - /// Initializes a new instance of the ActionRulesGetByNameHeaders - /// class. + /// Initializes a new instance of the + /// AlertProcessingRulesCreateOrUpdateHeaders class. /// /// Service generated Request ID. - public ActionRulesGetByNameHeaders(string xMsRequestId = default(string)) + public AlertProcessingRulesCreateOrUpdateHeaders(string xMsRequestId = default(string)) { XMsRequestId = xMsRequestId; CustomInit(); diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesDeleteHeaders.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesDeleteHeaders.cs similarity index 75% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesDeleteHeaders.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesDeleteHeaders.cs index 476235d80dc6..51586fd9cd72 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesDeleteHeaders.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesDeleteHeaders.cs @@ -16,21 +16,23 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines headers for Delete operation. /// - public partial class ActionRulesDeleteHeaders + public partial class AlertProcessingRulesDeleteHeaders { /// - /// Initializes a new instance of the ActionRulesDeleteHeaders class. + /// Initializes a new instance of the AlertProcessingRulesDeleteHeaders + /// class. /// - public ActionRulesDeleteHeaders() + public AlertProcessingRulesDeleteHeaders() { CustomInit(); } /// - /// Initializes a new instance of the ActionRulesDeleteHeaders class. + /// Initializes a new instance of the AlertProcessingRulesDeleteHeaders + /// class. /// /// Service generated Request ID. - public ActionRulesDeleteHeaders(string xMsRequestId = default(string)) + public AlertProcessingRulesDeleteHeaders(string xMsRequestId = default(string)) { XMsRequestId = xMsRequestId; CustomInit(); diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesListBySubscriptionHeaders.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesGetByNameHeaders.cs similarity index 79% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesListBySubscriptionHeaders.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesGetByNameHeaders.cs index 58364ac61da0..16eff36904dd 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesListBySubscriptionHeaders.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesGetByNameHeaders.cs @@ -14,25 +14,25 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models using System.Linq; /// - /// Defines headers for ListBySubscription operation. + /// Defines headers for GetByName operation. /// - public partial class ActionRulesListBySubscriptionHeaders + public partial class AlertProcessingRulesGetByNameHeaders { /// /// Initializes a new instance of the - /// ActionRulesListBySubscriptionHeaders class. + /// AlertProcessingRulesGetByNameHeaders class. /// - public ActionRulesListBySubscriptionHeaders() + public AlertProcessingRulesGetByNameHeaders() { CustomInit(); } /// /// Initializes a new instance of the - /// ActionRulesListBySubscriptionHeaders class. + /// AlertProcessingRulesGetByNameHeaders class. /// /// Service generated Request ID. - public ActionRulesListBySubscriptionHeaders(string xMsRequestId = default(string)) + public AlertProcessingRulesGetByNameHeaders(string xMsRequestId = default(string)) { XMsRequestId = xMsRequestId; CustomInit(); diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesListByResourceGroupHeaders.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesListByResourceGroupHeaders.cs similarity index 78% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesListByResourceGroupHeaders.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesListByResourceGroupHeaders.cs index c127822fa262..a392ad9f0287 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesListByResourceGroupHeaders.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesListByResourceGroupHeaders.cs @@ -16,23 +16,23 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines headers for ListByResourceGroup operation. /// - public partial class ActionRulesListByResourceGroupHeaders + public partial class AlertProcessingRulesListByResourceGroupHeaders { /// /// Initializes a new instance of the - /// ActionRulesListByResourceGroupHeaders class. + /// AlertProcessingRulesListByResourceGroupHeaders class. /// - public ActionRulesListByResourceGroupHeaders() + public AlertProcessingRulesListByResourceGroupHeaders() { CustomInit(); } /// /// Initializes a new instance of the - /// ActionRulesListByResourceGroupHeaders class. + /// AlertProcessingRulesListByResourceGroupHeaders class. /// /// Service generated Request ID. - public ActionRulesListByResourceGroupHeaders(string xMsRequestId = default(string)) + public AlertProcessingRulesListByResourceGroupHeaders(string xMsRequestId = default(string)) { XMsRequestId = xMsRequestId; CustomInit(); diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs new file mode 100644 index 000000000000..4935b594934f --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs @@ -0,0 +1,53 @@ +// +// 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.AlertsManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for ListBySubscription operation. + /// + public partial class AlertProcessingRulesListBySubscriptionHeaders + { + /// + /// Initializes a new instance of the + /// AlertProcessingRulesListBySubscriptionHeaders class. + /// + public AlertProcessingRulesListBySubscriptionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AlertProcessingRulesListBySubscriptionHeaders class. + /// + /// Service generated Request ID. + public AlertProcessingRulesListBySubscriptionHeaders(string xMsRequestId = default(string)) + { + XMsRequestId = xMsRequestId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets service generated Request ID. + /// + [JsonProperty(PropertyName = "x-ms-request-id")] + public string XMsRequestId { get; set; } + + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesUpdateHeaders.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesUpdateHeaders.cs similarity index 75% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesUpdateHeaders.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesUpdateHeaders.cs index bec4da1f101f..657eeedee094 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesUpdateHeaders.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertProcessingRulesUpdateHeaders.cs @@ -16,21 +16,23 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines headers for Update operation. /// - public partial class ActionRulesUpdateHeaders + public partial class AlertProcessingRulesUpdateHeaders { /// - /// Initializes a new instance of the ActionRulesUpdateHeaders class. + /// Initializes a new instance of the AlertProcessingRulesUpdateHeaders + /// class. /// - public ActionRulesUpdateHeaders() + public AlertProcessingRulesUpdateHeaders() { CustomInit(); } /// - /// Initializes a new instance of the ActionRulesUpdateHeaders class. + /// Initializes a new instance of the AlertProcessingRulesUpdateHeaders + /// class. /// /// Service generated Request ID. - public ActionRulesUpdateHeaders(string xMsRequestId = default(string)) + public AlertProcessingRulesUpdateHeaders(string xMsRequestId = default(string)) { XMsRequestId = xMsRequestId; CustomInit(); diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroup.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroup.cs index 92d576faace7..eadbf7420ae0 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroup.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroup.cs @@ -36,7 +36,7 @@ public AlertsSummaryGroup() /// groups. /// Name of the field aggregated /// List of the items - public AlertsSummaryGroup(int? total = default(int?), int? smartGroupsCount = default(int?), string groupedby = default(string), IList values = default(IList)) + public AlertsSummaryGroup(long? total = default(long?), long? smartGroupsCount = default(long?), string groupedby = default(string), IList values = default(IList)) { Total = total; SmartGroupsCount = smartGroupsCount; @@ -54,13 +54,13 @@ public AlertsSummaryGroup() /// Gets or sets total count of the result set. /// [JsonProperty(PropertyName = "total")] - public int? Total { get; set; } + public long? Total { get; set; } /// /// Gets or sets total count of the smart groups. /// [JsonProperty(PropertyName = "smartGroupsCount")] - public int? SmartGroupsCount { get; set; } + public long? SmartGroupsCount { get; set; } /// /// Gets or sets name of the field aggregated diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroupItem.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroupItem.cs index e62b113df121..2268acfa0eca 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroupItem.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/AlertsSummaryGroupItem.cs @@ -35,7 +35,7 @@ public AlertsSummaryGroupItem() /// Count of the aggregated field /// Name of the field aggregated /// List of the items - public AlertsSummaryGroupItem(string name = default(string), int? count = default(int?), string groupedby = default(string), IList values = default(IList)) + public AlertsSummaryGroupItem(string name = default(string), long? count = default(long?), string groupedby = default(string), IList values = default(IList)) { Name = name; Count = count; @@ -59,7 +59,7 @@ public AlertsSummaryGroupItem() /// Gets or sets count of the aggregated field /// [JsonProperty(PropertyName = "count")] - public int? Count { get; set; } + public long? Count { get; set; } /// /// Gets or sets name of the field aggregated diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Condition.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Condition.cs index dccc9879bf78..69f3dc22fc10 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Condition.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Condition.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models using System.Linq; /// - /// condition to trigger an action rule + /// Condition to trigger an alert processing rule. /// public partial class Condition { @@ -31,13 +31,19 @@ public Condition() /// /// Initializes a new instance of the Condition class. /// - /// operator for a given condition. + /// Field for a given condition. Possible values + /// include: 'Severity', 'MonitorService', 'MonitorCondition', + /// 'SignalType', 'TargetResourceType', 'TargetResource', + /// 'TargetResourceGroup', 'AlertRuleId', 'AlertRuleName', + /// 'Description', 'AlertContext' + /// Operator for a given condition. /// Possible values include: 'Equals', 'NotEquals', 'Contains', /// 'DoesNotContain' - /// list of values to match for a given + /// List of values to match for a given /// condition. - public Condition(string operatorProperty = default(string), IList values = default(IList)) + public Condition(string field = default(string), string operatorProperty = default(string), IList values = default(IList)) { + Field = field; OperatorProperty = operatorProperty; Values = values; CustomInit(); @@ -48,6 +54,15 @@ public Condition() /// partial void CustomInit(); + /// + /// Gets or sets field for a given condition. Possible values include: + /// 'Severity', 'MonitorService', 'MonitorCondition', 'SignalType', + /// 'TargetResourceType', 'TargetResource', 'TargetResourceGroup', + /// 'AlertRuleId', 'AlertRuleName', 'Description', 'AlertContext' + /// + [JsonProperty(PropertyName = "field")] + public string Field { get; set; } + /// /// Gets or sets operator for a given condition. Possible values /// include: 'Equals', 'NotEquals', 'Contains', 'DoesNotContain' diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Conditions.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Conditions.cs deleted file mode 100644 index aaab7268eea9..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Conditions.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -// 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.AlertsManagement.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Conditions in alert instance to be matched for a given action rule. - /// Default value is all. Multiple values could be provided with comma - /// separation. - /// - public partial class Conditions - { - /// - /// Initializes a new instance of the Conditions class. - /// - public Conditions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Conditions class. - /// - /// filter alerts by severity - /// filter alerts by monitor - /// service - /// filter alerts by monitor - /// condition - /// filter alerts by target resource - /// type - /// filter alerts by alert rule id - /// filter alerts by alert rule - /// description - /// filter alerts by alert context - /// (payload) - public Conditions(Condition severity = default(Condition), Condition monitorService = default(Condition), Condition monitorCondition = default(Condition), Condition targetResourceType = default(Condition), Condition alertRuleId = default(Condition), Condition description = default(Condition), Condition alertContext = default(Condition)) - { - Severity = severity; - MonitorService = monitorService; - MonitorCondition = monitorCondition; - TargetResourceType = targetResourceType; - AlertRuleId = alertRuleId; - Description = description; - AlertContext = alertContext; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets filter alerts by severity - /// - [JsonProperty(PropertyName = "severity")] - public Condition Severity { get; set; } - - /// - /// Gets or sets filter alerts by monitor service - /// - [JsonProperty(PropertyName = "monitorService")] - public Condition MonitorService { get; set; } - - /// - /// Gets or sets filter alerts by monitor condition - /// - [JsonProperty(PropertyName = "monitorCondition")] - public Condition MonitorCondition { get; set; } - - /// - /// Gets or sets filter alerts by target resource type - /// - [JsonProperty(PropertyName = "targetResourceType")] - public Condition TargetResourceType { get; set; } - - /// - /// Gets or sets filter alerts by alert rule id - /// - [JsonProperty(PropertyName = "alertRuleId")] - public Condition AlertRuleId { get; set; } - - /// - /// Gets or sets filter alerts by alert rule description - /// - [JsonProperty(PropertyName = "description")] - public Condition Description { get; set; } - - /// - /// Gets or sets filter alerts by alert context (payload) - /// - [JsonProperty(PropertyName = "alertContext")] - public Condition AlertContext { get; set; } - - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRuleStatus.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/CreatedByType.cs similarity index 62% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRuleStatus.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/CreatedByType.cs index cdecbe57ea4e..141356b0d1c9 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRuleStatus.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/CreatedByType.cs @@ -12,11 +12,13 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models { /// - /// Defines values for ActionRuleStatus. + /// Defines values for CreatedByType. /// - public static class ActionRuleStatus + public static class CreatedByType { - public const string Enabled = "Enabled"; - public const string Disabled = "Disabled"; + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesCreateUpdateHeaders.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/DailyRecurrence.cs similarity index 53% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesCreateUpdateHeaders.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/DailyRecurrence.cs index 6bfd2de04a5b..47898942f72d 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ActionRulesCreateUpdateHeaders.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/DailyRecurrence.cs @@ -14,27 +14,27 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models using System.Linq; /// - /// Defines headers for CreateUpdate operation. + /// Daily recurrence object. /// - public partial class ActionRulesCreateUpdateHeaders + [Newtonsoft.Json.JsonObject("Daily")] + public partial class DailyRecurrence : Recurrence { /// - /// Initializes a new instance of the ActionRulesCreateUpdateHeaders - /// class. + /// Initializes a new instance of the DailyRecurrence class. /// - public ActionRulesCreateUpdateHeaders() + public DailyRecurrence() { CustomInit(); } /// - /// Initializes a new instance of the ActionRulesCreateUpdateHeaders - /// class. + /// Initializes a new instance of the DailyRecurrence class. /// - /// Service generated Request ID. - public ActionRulesCreateUpdateHeaders(string xMsRequestId = default(string)) + /// Start time for recurrence. + /// End time for recurrence. + public DailyRecurrence(string startTime = default(string), string endTime = default(string)) + : base(startTime, endTime) { - XMsRequestId = xMsRequestId; CustomInit(); } @@ -43,11 +43,5 @@ public ActionRulesCreateUpdateHeaders() /// partial void CustomInit(); - /// - /// Gets or sets service generated Request ID. - /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionType.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/DaysOfWeek.cs similarity index 52% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionType.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/DaysOfWeek.cs index 3b5879f10ba1..d2fd2f43bdd8 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionType.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/DaysOfWeek.cs @@ -12,14 +12,16 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models { /// - /// Defines values for SuppressionType. + /// Defines values for DaysOfWeek. /// - public static class SuppressionType + public static class DaysOfWeek { - public const string Always = "Always"; - public const string Once = "Once"; - public const string Daily = "Daily"; - public const string Weekly = "Weekly"; - public const string Monthly = "Monthly"; + public const string Sunday = "Sunday"; + public const string Monday = "Monday"; + public const string Tuesday = "Tuesday"; + public const string Wednesday = "Wednesday"; + public const string Thursday = "Thursday"; + public const string Friday = "Friday"; + public const string Saturday = "Saturday"; } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Diagnostics.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Diagnostics.cs deleted file mode 100644 index ccd078742e52..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Diagnostics.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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.AlertsManagement.Models -{ - using System.Linq; - - /// - /// Diagnostics based Action Rule - /// - /// - /// Action rule with diagnostics configuration - /// - public partial class Diagnostics : ActionRuleProperties - { - /// - /// Initializes a new instance of the Diagnostics class. - /// - public Diagnostics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Diagnostics class. - /// - /// scope on which action rule will apply - /// conditions on which alerts will be - /// filtered - /// Description of action rule - /// Creation time of action rule. Date-Time in - /// ISO-8601 format. - /// Last updated time of action rule. - /// Date-Time in ISO-8601 format. - /// Created by user name. - /// Last modified by user name. - /// Indicates if the given action rule is enabled - /// or disabled. Possible values include: 'Enabled', 'Disabled' - public Diagnostics(Scope scope = default(Scope), Conditions conditions = default(Conditions), string description = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? lastModifiedAt = default(System.DateTime?), string createdBy = default(string), string lastModifiedBy = default(string), string status = default(string)) - : base(scope, conditions, description, createdAt, lastModifiedAt, createdBy, lastModifiedBy, status) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Field.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Field.cs new file mode 100644 index 000000000000..f566f25f64b4 --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Field.cs @@ -0,0 +1,31 @@ +// +// 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.AlertsManagement.Models +{ + + /// + /// Defines values for Field. + /// + public static class Field + { + public const string Severity = "Severity"; + public const string MonitorService = "MonitorService"; + public const string MonitorCondition = "MonitorCondition"; + public const string SignalType = "SignalType"; + public const string TargetResourceType = "TargetResourceType"; + public const string TargetResource = "TargetResource"; + public const string TargetResourceGroup = "TargetResourceGroup"; + public const string AlertRuleId = "AlertRuleId"; + public const string AlertRuleName = "AlertRuleName"; + public const string Description = "Description"; + public const string AlertContext = "AlertContext"; + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ManagedResource.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ManagedResource.cs index 71313ea550cf..b5a39fd4af9d 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ManagedResource.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/ManagedResource.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models using System.Linq; /// - /// An azure managed resource object + /// An azure managed resource object. /// public partial class ManagedResource : Resource { diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionConfig.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/MonthlyRecurrence.cs similarity index 50% rename from sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionConfig.cs rename to sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/MonthlyRecurrence.cs index 2693fc51c369..b6451a5eafa4 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionConfig.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/MonthlyRecurrence.cs @@ -12,32 +12,35 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Suppression logic for a given action rule + /// Monthly recurrence object. /// - public partial class SuppressionConfig + [Newtonsoft.Json.JsonObject("Monthly")] + public partial class MonthlyRecurrence : Recurrence { /// - /// Initializes a new instance of the SuppressionConfig class. + /// Initializes a new instance of the MonthlyRecurrence class. /// - public SuppressionConfig() + public MonthlyRecurrence() { CustomInit(); } /// - /// Initializes a new instance of the SuppressionConfig class. + /// Initializes a new instance of the MonthlyRecurrence class. /// - /// Specifies when the suppression should - /// be applied. Possible values include: 'Always', 'Once', 'Daily', - /// 'Weekly', 'Monthly' - /// suppression schedule configuration - public SuppressionConfig(string recurrenceType, SuppressionSchedule schedule = default(SuppressionSchedule)) + /// Specifies the values for monthly + /// recurrence pattern. + /// Start time for recurrence. + /// End time for recurrence. + public MonthlyRecurrence(IList daysOfMonth, string startTime = default(string), string endTime = default(string)) + : base(startTime, endTime) { - RecurrenceType = recurrenceType; - Schedule = schedule; + DaysOfMonth = daysOfMonth; CustomInit(); } @@ -47,18 +50,10 @@ public SuppressionConfig() partial void CustomInit(); /// - /// Gets or sets specifies when the suppression should be applied. - /// Possible values include: 'Always', 'Once', 'Daily', 'Weekly', - /// 'Monthly' + /// Gets or sets specifies the values for monthly recurrence pattern. /// - [JsonProperty(PropertyName = "recurrenceType")] - public string RecurrenceType { get; set; } - - /// - /// Gets or sets suppression schedule configuration - /// - [JsonProperty(PropertyName = "schedule")] - public SuppressionSchedule Schedule { get; set; } + [JsonProperty(PropertyName = "daysOfMonth")] + public IList DaysOfMonth { get; set; } /// /// Validate the object. @@ -68,9 +63,9 @@ public SuppressionConfig() /// public virtual void Validate() { - if (RecurrenceType == null) + if (DaysOfMonth == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RecurrenceType"); + throw new ValidationException(ValidationRules.CannotBeNull, "DaysOfMonth"); } } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/PatchObject.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/PatchObject.cs index 8143db92b2c7..49ed4f6441c9 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/PatchObject.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/PatchObject.cs @@ -13,10 +13,12 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Data contract for patch + /// Data contract for patch. /// [Rest.Serialization.JsonTransformation] public partial class PatchObject @@ -32,12 +34,12 @@ public PatchObject() /// /// Initializes a new instance of the PatchObject class. /// - /// Indicates if the given action rule is enabled - /// or disabled. Possible values include: 'Enabled', 'Disabled' - /// tags to be updated - public PatchObject(string status = default(string), object tags = default(object)) + /// Indicates if the given alert processing rule + /// is enabled or disabled. + /// Tags to be updated. + public PatchObject(bool? enabled = default(bool?), IDictionary tags = default(IDictionary)) { - Status = status; + Enabled = enabled; Tags = tags; CustomInit(); } @@ -48,17 +50,17 @@ public PatchObject() partial void CustomInit(); /// - /// Gets or sets indicates if the given action rule is enabled or - /// disabled. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets indicates if the given alert processing rule is + /// enabled or disabled. /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } /// - /// Gets or sets tags to be updated + /// Gets or sets tags to be updated. /// [JsonProperty(PropertyName = "tags")] - public object Tags { get; set; } + public IDictionary Tags { get; set; } } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Recurrence.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Recurrence.cs new file mode 100644 index 000000000000..2ecb97ea0e10 --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Recurrence.cs @@ -0,0 +1,59 @@ +// +// 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.AlertsManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Recurrence object. + /// + public partial class Recurrence + { + /// + /// Initializes a new instance of the Recurrence class. + /// + public Recurrence() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Recurrence class. + /// + /// Start time for recurrence. + /// End time for recurrence. + public Recurrence(string startTime = default(string), string endTime = default(string)) + { + StartTime = startTime; + EndTime = endTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets start time for recurrence. + /// + [JsonProperty(PropertyName = "startTime")] + public string StartTime { get; set; } + + /// + /// Gets or sets end time for recurrence. + /// + [JsonProperty(PropertyName = "endTime")] + public string EndTime { get; set; } + + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/RemoveAllActionGroups.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/RemoveAllActionGroups.cs new file mode 100644 index 000000000000..7aa225338215 --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/RemoveAllActionGroups.cs @@ -0,0 +1,35 @@ +// +// 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.AlertsManagement.Models +{ + using System.Linq; + + /// + /// Indicates if all action groups should be removed. + /// + public partial class RemoveAllActionGroups : Action + { + /// + /// Initializes a new instance of the RemoveAllActionGroups class. + /// + public RemoveAllActionGroups() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Schedule.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Schedule.cs new file mode 100644 index 000000000000..0e08da86fd93 --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Schedule.cs @@ -0,0 +1,105 @@ +// +// 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.AlertsManagement.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Scheduling configuration for a given alert processing rule. + /// + public partial class Schedule + { + /// + /// Initializes a new instance of the Schedule class. + /// + public Schedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Schedule class. + /// + /// Scheduling effective from time. + /// Date-Time in ISO-8601 format without timezone suffix. + /// Scheduling effective until time. + /// Date-Time in ISO-8601 format without timezone suffix. + /// Scheduling time zone. + /// List of recurrences. + public Schedule(string effectiveFrom = default(string), string effectiveUntil = default(string), string timeZone = default(string), IList recurrences = default(IList)) + { + EffectiveFrom = effectiveFrom; + EffectiveUntil = effectiveUntil; + TimeZone = timeZone; + Recurrences = recurrences; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets scheduling effective from time. Date-Time in ISO-8601 + /// format without timezone suffix. + /// + [JsonProperty(PropertyName = "effectiveFrom")] + public string EffectiveFrom { get; set; } + + /// + /// Gets or sets scheduling effective until time. Date-Time in ISO-8601 + /// format without timezone suffix. + /// + [JsonProperty(PropertyName = "effectiveUntil")] + public string EffectiveUntil { get; set; } + + /// + /// Gets or sets scheduling time zone. + /// + [JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + + /// + /// Gets or sets list of recurrences. + /// + [JsonProperty(PropertyName = "recurrences")] + public IList Recurrences { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (EffectiveFrom != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(EffectiveFrom, "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$")) + { + throw new ValidationException(ValidationRules.Pattern, "EffectiveFrom", "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$"); + } + } + if (EffectiveUntil != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(EffectiveUntil, "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$")) + { + throw new ValidationException(ValidationRules.Pattern, "EffectiveUntil", "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$"); + } + } + } + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Scope.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Scope.cs deleted file mode 100644 index b8b8a5e32e3f..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Scope.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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.AlertsManagement.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Target scope for a given action rule. By default scope will be the - /// subscription. User can also provide list of resource groups or list of - /// resources from the scope subscription as well. - /// - public partial class Scope - { - /// - /// Initializes a new instance of the Scope class. - /// - public Scope() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Scope class. - /// - /// type of target scope. Possible values - /// include: 'ResourceGroup', 'Resource', 'Subscription' - /// list of ARM IDs of the given scope type which - /// will be the target of the given action rule. - public Scope(string scopeType = default(string), IList values = default(IList)) - { - ScopeType = scopeType; - Values = values; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of target scope. Possible values include: - /// 'ResourceGroup', 'Resource', 'Subscription' - /// - [JsonProperty(PropertyName = "scopeType")] - public string ScopeType { get; set; } - - /// - /// Gets or sets list of ARM IDs of the given scope type which will be - /// the target of the given action rule. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroup.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroup.cs index 279b8b50d46b..94c270ac3fc7 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroup.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroup.cs @@ -68,7 +68,7 @@ public SmartGroup() /// The URI to fetch the next page of alerts. /// Call ListNext() with this URI to fetch the next page /// alerts. - public SmartGroup(string id = default(string), string type = default(string), string name = default(string), int? alertsCount = default(int?), string smartGroupState = default(string), string severity = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string lastModifiedUserName = default(string), IList resources = default(IList), IList resourceTypes = default(IList), IList resourceGroups = default(IList), IList monitorServices = default(IList), IList monitorConditions = default(IList), IList alertStates = default(IList), IList alertSeverities = default(IList), string nextLink = default(string)) + public SmartGroup(string id = default(string), string type = default(string), string name = default(string), long? alertsCount = default(long?), string smartGroupState = default(string), string severity = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string lastModifiedUserName = default(string), IList resources = default(IList), IList resourceTypes = default(IList), IList resourceGroups = default(IList), IList monitorServices = default(IList), IList monitorConditions = default(IList), IList alertStates = default(IList), IList alertSeverities = default(IList), string nextLink = default(string)) : base(id, type, name) { AlertsCount = alertsCount; @@ -97,7 +97,7 @@ public SmartGroup() /// Gets or sets total number of alerts in smart group /// [JsonProperty(PropertyName = "properties.alertsCount")] - public int? AlertsCount { get; set; } + public long? AlertsCount { get; set; } /// /// Gets smart group state. Possible values include: 'New', diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroupAggregatedProperty.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroupAggregatedProperty.cs index 1b411d1885fb..ba75c078ce70 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroupAggregatedProperty.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SmartGroupAggregatedProperty.cs @@ -33,7 +33,7 @@ public SmartGroupAggregatedProperty() /// /// Name of the type. /// Total number of items of type. - public SmartGroupAggregatedProperty(string name = default(string), int? count = default(int?)) + public SmartGroupAggregatedProperty(string name = default(string), long? count = default(long?)) { Name = name; Count = count; @@ -55,7 +55,7 @@ public SmartGroupAggregatedProperty() /// Gets or sets total number of items of type. /// [JsonProperty(PropertyName = "count")] - public int? Count { get; set; } + public long? Count { get; set; } } } diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Suppression.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Suppression.cs deleted file mode 100644 index ffe778345baa..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/Suppression.cs +++ /dev/null @@ -1,86 +0,0 @@ -// -// 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.AlertsManagement.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Suppression based Action Rule - /// - /// - /// Action rule with suppression configuration - /// - public partial class Suppression : ActionRuleProperties - { - /// - /// Initializes a new instance of the Suppression class. - /// - public Suppression() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Suppression class. - /// - /// suppression configuration for the - /// action rule - /// scope on which action rule will apply - /// conditions on which alerts will be - /// filtered - /// Description of action rule - /// Creation time of action rule. Date-Time in - /// ISO-8601 format. - /// Last updated time of action rule. - /// Date-Time in ISO-8601 format. - /// Created by user name. - /// Last modified by user name. - /// Indicates if the given action rule is enabled - /// or disabled. Possible values include: 'Enabled', 'Disabled' - public Suppression(SuppressionConfig suppressionConfig, Scope scope = default(Scope), Conditions conditions = default(Conditions), string description = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? lastModifiedAt = default(System.DateTime?), string createdBy = default(string), string lastModifiedBy = default(string), string status = default(string)) - : base(scope, conditions, description, createdAt, lastModifiedAt, createdBy, lastModifiedBy, status) - { - SuppressionConfig = suppressionConfig; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets suppression configuration for the action rule - /// - [JsonProperty(PropertyName = "suppressionConfig")] - public SuppressionConfig SuppressionConfig { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SuppressionConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SuppressionConfig"); - } - if (SuppressionConfig != null) - { - SuppressionConfig.Validate(); - } - } - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionSchedule.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionSchedule.cs deleted file mode 100644 index 6c2779324c2c..000000000000 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SuppressionSchedule.cs +++ /dev/null @@ -1,86 +0,0 @@ -// -// 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.AlertsManagement.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Schedule for a given suppression configuration. - /// - public partial class SuppressionSchedule - { - /// - /// Initializes a new instance of the SuppressionSchedule class. - /// - public SuppressionSchedule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SuppressionSchedule class. - /// - /// Start date for suppression - /// End date for suppression - /// Start time for suppression - /// End date for suppression - /// Specifies the values for recurrence - /// pattern - public SuppressionSchedule(string startDate = default(string), string endDate = default(string), string startTime = default(string), string endTime = default(string), IList recurrenceValues = default(IList)) - { - StartDate = startDate; - EndDate = endDate; - StartTime = startTime; - EndTime = endTime; - RecurrenceValues = recurrenceValues; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets start date for suppression - /// - [JsonProperty(PropertyName = "startDate")] - public string StartDate { get; set; } - - /// - /// Gets or sets end date for suppression - /// - [JsonProperty(PropertyName = "endDate")] - public string EndDate { get; set; } - - /// - /// Gets or sets start time for suppression - /// - [JsonProperty(PropertyName = "startTime")] - public string StartTime { get; set; } - - /// - /// Gets or sets end date for suppression - /// - [JsonProperty(PropertyName = "endTime")] - public string EndTime { get; set; } - - /// - /// Gets or sets specifies the values for recurrence pattern - /// - [JsonProperty(PropertyName = "recurrenceValues")] - public IList RecurrenceValues { get; set; } - - } -} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SystemData.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..5b2236343f8f --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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.AlertsManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/WeeklyRecurrence.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/WeeklyRecurrence.cs new file mode 100644 index 000000000000..ce8d2ee311ee --- /dev/null +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Models/WeeklyRecurrence.cs @@ -0,0 +1,72 @@ +// +// 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.AlertsManagement.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Weekly recurrence object. + /// + [Newtonsoft.Json.JsonObject("Weekly")] + public partial class WeeklyRecurrence : Recurrence + { + /// + /// Initializes a new instance of the WeeklyRecurrence class. + /// + public WeeklyRecurrence() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeeklyRecurrence class. + /// + /// Specifies the values for weekly recurrence + /// pattern. + /// Start time for recurrence. + /// End time for recurrence. + public WeeklyRecurrence(IList daysOfWeek, string startTime = default(string), string endTime = default(string)) + : base(startTime, endTime) + { + DaysOfWeek = daysOfWeek; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the values for weekly recurrence pattern. + /// + [JsonProperty(PropertyName = "daysOfWeek")] + public IList DaysOfWeek { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DaysOfWeek == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DaysOfWeek"); + } + } + } +} diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Operations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Operations.cs index 16c37fe1dac6..079216703675 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Operations.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/Operations.cs @@ -60,7 +60,7 @@ internal Operations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -71,6 +71,7 @@ internal Operations(AlertsManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -78,6 +79,7 @@ internal Operations(AlertsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -85,9 +87,9 @@ internal Operations(AlertsManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.AlertsManagement/operations").ToString(); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -149,14 +151,13 @@ internal Operations(AlertsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -166,10 +167,6 @@ internal Operations(AlertsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -227,7 +224,7 @@ internal Operations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -323,14 +320,13 @@ internal Operations(AlertsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -340,10 +336,6 @@ internal Operations(AlertsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SdkInfo_AlertsManagementClient.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SdkInfo_AlertsManagementClient.cs index 02e5fe3aad30..4ab23101e302 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SdkInfo_AlertsManagementClient.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SdkInfo_AlertsManagementClient.cs @@ -19,23 +19,12 @@ public static IEnumerable> ApiInfo_AlertsManagemen { return new Tuple[] { - new Tuple("AlertsManagement", "ActionRules", "2019-05-05-preview"), + new Tuple("AlertsManagement", "AlertProcessingRules", "2021-08-08"), new Tuple("AlertsManagement", "Alerts", "2019-05-05-preview"), new Tuple("AlertsManagement", "Operations", "2019-05-05-preview"), new Tuple("AlertsManagement", "SmartGroups", "2019-05-05-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/alertsmanagement/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-preview-2019-05 --csharp-sdks-folder=C:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "98f100daf12446cbdc6359ba9b34e8a10f8410f3"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperations.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperations.cs index 866a9a0eec3f..0d23c73a76c6 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperations.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperations.cs @@ -126,7 +126,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -139,6 +139,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -157,6 +158,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) tracingParameters.Add("pageCount", pageCount); tracingParameters.Add("sortBy", sortBy); tracingParameters.Add("sortOrder", sortOrder); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetAll", tracingParameters); } @@ -209,9 +211,9 @@ internal SmartGroupsOperations(AlertsManagementClient client) { _queryParameters.Add(string.Format("sortOrder={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sortOrder, Client.SerializationSettings).Trim('"')))); } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -380,6 +382,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "smartGroupId"); } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -388,6 +391,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("smartGroupId", smartGroupId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); } @@ -397,9 +401,9 @@ internal SmartGroupsOperations(AlertsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{smartGroupId}", System.Uri.EscapeDataString(smartGroupId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -586,6 +590,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "newState"); } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -594,6 +599,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("smartGroupId", smartGroupId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("newState", newState); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ChangeState", tracingParameters); @@ -604,9 +610,9 @@ internal SmartGroupsOperations(AlertsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{smartGroupId}", System.Uri.EscapeDataString(smartGroupId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (newState != null) { @@ -790,6 +796,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "smartGroupId"); } + string apiVersion = "2019-05-05-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -798,6 +805,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("smartGroupId", smartGroupId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetHistory", tracingParameters); } @@ -807,9 +815,9 @@ internal SmartGroupsOperations(AlertsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{smartGroupId}", System.Uri.EscapeDataString(smartGroupId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperationsExtensions.cs b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperationsExtensions.cs index c596aabb2c2e..a14927b11e3c 100644 --- a/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperationsExtensions.cs +++ b/sdk/alertsmanagement/Microsoft.Azure.Management.AlertsManagement/src/Generated/SmartGroupsOperationsExtensions.cs @@ -79,7 +79,7 @@ public static partial class SmartGroupsOperationsExtensions /// value is 'desc' for time fields and 'asc' for others. Possible values /// include: 'asc', 'desc' /// - public static IPage GetAll(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string)) + public static IPage GetAll(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string)) { return operations.GetAllAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder).GetAwaiter().GetResult(); } @@ -145,7 +145,7 @@ public static partial class SmartGroupsOperationsExtensions /// /// The cancellation token. /// - public static async Task> GetAllAsync(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), int? pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetAllAsync(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder, null, cancellationToken).ConfigureAwait(false)) {