diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs index e1e63466085b6..5a7a39e083774 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs @@ -54,7 +54,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) /// Create a new action group or update an existing one. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -89,6 +89,17 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (actionGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName"); @@ -105,6 +116,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -279,7 +297,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) /// Get an action group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -311,6 +329,17 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (actionGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName"); @@ -319,6 +348,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -468,7 +504,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) /// Delete an action group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -497,6 +533,17 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (actionGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName"); @@ -505,6 +552,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -637,7 +691,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) /// CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -672,10 +726,28 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (actionGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName"); @@ -866,6 +938,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1011,7 +1090,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) /// Get a list of all action groups in a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -1040,10 +1119,28 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1193,7 +1290,7 @@ internal ActionGroupsOperations(MonitorManagementClient client) /// receivers. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -1225,6 +1322,17 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (actionGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName"); @@ -1233,6 +1341,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (receiverName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "receiverName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperationsExtensions.cs index 4583e18a46247..7ec93dfab1a83 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class ActionGroupsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -50,7 +50,7 @@ public static ActionGroupResource CreateOrUpdate(this IActionGroupsOperations op /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -76,7 +76,7 @@ public static ActionGroupResource CreateOrUpdate(this IActionGroupsOperations op /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -93,7 +93,7 @@ public static ActionGroupResource Get(this IActionGroupsOperations operations, s /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -116,7 +116,7 @@ public static ActionGroupResource Get(this IActionGroupsOperations operations, s /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -133,7 +133,7 @@ public static void Delete(this IActionGroupsOperations operations, string resour /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -154,7 +154,7 @@ public static void Delete(this IActionGroupsOperations operations, string resour /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -175,7 +175,7 @@ public static ActionGroupResource Update(this IActionGroupsOperations operations /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -229,7 +229,7 @@ public static IEnumerable ListBySubscriptionId(this IAction /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// public static IEnumerable ListByResourceGroup(this IActionGroupsOperations operations, string resourceGroupName) { @@ -243,7 +243,7 @@ public static IEnumerable ListByResourceGroup(this IActionG /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. @@ -265,7 +265,7 @@ public static IEnumerable ListByResourceGroup(this IActionG /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -287,7 +287,7 @@ public static void EnableReceiver(this IActionGroupsOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs index 861e5a5c1e240..fb328785dc0ae 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs @@ -54,7 +54,7 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) /// Create a new activity log alert or update an existing one. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -89,10 +89,28 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (activityLogAlertName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName"); @@ -279,7 +297,7 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) /// Get an activity log alert. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -311,10 +329,28 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (activityLogAlertName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName"); @@ -468,7 +504,7 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) /// Delete an activity log alert. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -497,10 +533,28 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (activityLogAlertName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName"); @@ -637,7 +691,7 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) /// use the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -672,10 +726,28 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (activityLogAlertName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName"); @@ -866,6 +938,13 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1011,7 +1090,7 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) /// Get a list of all activity log alerts in a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -1040,10 +1119,28 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperationsExtensions.cs index 80f03326243b7..4f52aac7d9d84 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class ActivityLogAlertsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -50,7 +50,7 @@ public static ActivityLogAlertResource CreateOrUpdate(this IActivityLogAlertsOpe /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -76,7 +76,7 @@ public static ActivityLogAlertResource CreateOrUpdate(this IActivityLogAlertsOpe /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -93,7 +93,7 @@ public static ActivityLogAlertResource Get(this IActivityLogAlertsOperations ope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -116,7 +116,7 @@ public static ActivityLogAlertResource Get(this IActivityLogAlertsOperations ope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -133,7 +133,7 @@ public static void Delete(this IActivityLogAlertsOperations operations, string r /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -154,7 +154,7 @@ public static void Delete(this IActivityLogAlertsOperations operations, string r /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -175,7 +175,7 @@ public static ActivityLogAlertResource Update(this IActivityLogAlertsOperations /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -229,7 +229,7 @@ public static IEnumerable ListBySubscriptionId(this IA /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// public static IEnumerable ListByResourceGroup(this IActivityLogAlertsOperations operations, string resourceGroupName) { @@ -243,7 +243,7 @@ public static IEnumerable ListByResourceGroup(this IAc /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs index 0bb485558e709..8e4f078e958a1 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs @@ -97,6 +97,13 @@ internal ActivityLogsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -113,7 +120,7 @@ internal ActivityLogsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (odataQuery != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs index 4f17f6c37e44c..1b50381a50e5f 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs @@ -54,7 +54,7 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) /// Gets an incident associated to an alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -89,6 +89,17 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -101,6 +112,13 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -252,7 +270,7 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) /// Gets a list of incidents associated to an alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -284,6 +302,17 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -292,6 +321,13 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperationsExtensions.cs index e80fe08e5e804..82f3e7347f9d7 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class AlertRuleIncidentsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -50,7 +50,7 @@ public static Incident Get(this IAlertRuleIncidentsOperations operations, string /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -76,7 +76,7 @@ public static Incident Get(this IAlertRuleIncidentsOperations operations, string /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -93,7 +93,7 @@ public static IEnumerable ListByAlertRule(this IAlertRuleIncidentsOper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs index 992f576643d7f..f9008268502ce 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs @@ -54,7 +54,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// Creates or updates a classic metric alert rule. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -89,6 +89,17 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -105,6 +116,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -122,7 +140,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -279,7 +297,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// Deletes a classic metric alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -290,7 +308,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -308,6 +326,17 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -316,6 +345,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -332,7 +368,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -401,14 +437,13 @@ internal AlertRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - 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; } } @@ -418,10 +453,6 @@ internal AlertRulesOperations(MonitorManagementClient 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); @@ -452,7 +483,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// Gets a classic metric alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -463,7 +494,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -484,6 +515,17 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -492,6 +534,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -508,7 +557,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -577,14 +626,13 @@ internal AlertRulesOperations(MonitorManagementClient 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; } } @@ -594,10 +642,6 @@ internal AlertRulesOperations(MonitorManagementClient 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); @@ -647,7 +691,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// fields use the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -682,10 +726,28 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -711,7 +773,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); @@ -868,7 +930,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// List the classic metric alert rules within a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -876,7 +938,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -897,10 +959,28 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -916,7 +996,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -984,14 +1064,13 @@ internal AlertRulesOperations(MonitorManagementClient 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; } } @@ -1001,10 +1080,6 @@ internal AlertRulesOperations(MonitorManagementClient 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); @@ -1058,7 +1133,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1079,6 +1154,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1093,7 +1175,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1160,14 +1242,13 @@ internal AlertRulesOperations(MonitorManagementClient 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; } } @@ -1177,10 +1258,6 @@ internal AlertRulesOperations(MonitorManagementClient 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/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperationsExtensions.cs index 1141a2deab66f..a803ec871d91f 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class AlertRulesOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -50,7 +50,7 @@ public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operat /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -76,7 +76,7 @@ public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operat /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -93,7 +93,7 @@ public static void Delete(this IAlertRulesOperations operations, string resource /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -113,7 +113,7 @@ public static void Delete(this IAlertRulesOperations operations, string resource /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -130,7 +130,7 @@ public static AlertRuleResource Get(this IAlertRulesOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -154,7 +154,7 @@ public static AlertRuleResource Get(this IAlertRulesOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -175,7 +175,7 @@ public static AlertRuleResource Update(this IAlertRulesOperations operations, st /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -201,7 +201,7 @@ public static AlertRuleResource Update(this IAlertRulesOperations operations, st /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// public static IEnumerable ListByResourceGroup(this IAlertRulesOperations operations, string resourceGroupName) { @@ -215,7 +215,7 @@ public static IEnumerable ListByResourceGroup(this IAlertRule /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs index 2d2193992b4bd..95b19aa4b48da 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs @@ -54,7 +54,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// Lists the autoscale settings for a resource group /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -83,10 +83,28 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -102,7 +120,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -234,7 +252,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// Creates or updates an autoscale setting. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -269,6 +287,17 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (autoscaleSettingName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName"); @@ -285,6 +314,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -302,7 +338,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -459,7 +495,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// Deletes and autoscale setting /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -488,6 +524,17 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (autoscaleSettingName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName"); @@ -496,6 +543,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -512,7 +566,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -627,7 +681,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// Gets an autoscale setting /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -659,6 +713,17 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (autoscaleSettingName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName"); @@ -667,6 +732,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -683,7 +755,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -817,7 +889,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -852,10 +924,28 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (autoscaleSettingName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName"); @@ -881,7 +971,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); @@ -1046,6 +1136,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1060,7 +1157,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/autoscalesettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperationsExtensions.cs index c93ea91bbe530..e43d0fda5f27f 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperationsExtensions.cs @@ -28,7 +28,7 @@ public static partial class AutoscaleSettingsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// public static IPage ListByResourceGroup(this IAutoscaleSettingsOperations operations, string resourceGroupName) { @@ -42,7 +42,7 @@ public static IPage ListByResourceGroup(this IAutoscal /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. @@ -62,7 +62,7 @@ public static IPage ListByResourceGroup(this IAutoscal /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -82,7 +82,7 @@ public static AutoscaleSettingResource CreateOrUpdate(this IAutoscaleSettingsOpe /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -108,7 +108,7 @@ public static AutoscaleSettingResource CreateOrUpdate(this IAutoscaleSettingsOpe /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -125,7 +125,7 @@ public static void Delete(this IAutoscaleSettingsOperations operations, string r /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -145,7 +145,7 @@ public static void Delete(this IAutoscaleSettingsOperations operations, string r /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -162,7 +162,7 @@ public static AutoscaleSettingResource Get(this IAutoscaleSettingsOperations ope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -186,7 +186,7 @@ public static AutoscaleSettingResource Get(this IAutoscaleSettingsOperations ope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -207,7 +207,7 @@ public static AutoscaleSettingResource Update(this IAutoscaleSettingsOperations /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs index 49715e977715f..fb3f7c291b863 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs @@ -57,7 +57,9 @@ internal BaselinesOperations(MonitorManagementClient client) /// The identifier of the resource. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special case: If a + /// metricname itself has a comma in it then use %2 to indicate it. Eg: + /// 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// Metric namespace to query metric definitions for. @@ -76,17 +78,20 @@ internal BaselinesOperations(MonitorManagementClient client) /// The list of sensitivities (comma separated) to retrieve. /// /// - /// The **$filter** is used to reduce the set of metric data - /// returned.<br>Example:<br>Metric contains metadata A, B and - /// C.<br>- Return all time series of C where A = a1 and B = b1 or - /// b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq - /// ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq - /// ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the - /// logical or operator cannot separate two different metadata - /// names.<br>- Return all time series where A = a1, B = b1 and C = - /// c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- - /// Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq - /// ‘*’ and C eq ‘*’**. + /// The **$filter** is used to reduce the set of metric data returned. Example: + /// Metric contains metadata A, B and C. - Return all time series of C where A + /// = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C + /// eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' + /// or B = 'b2'** This is invalid because the logical or operator cannot + /// separate two different metadata names. - Return all time series where A = + /// a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - + /// Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C + /// eq '*'**. Special case: When dimension name or dimension value uses round + /// brackets. Eg: When dimension name is **dim (test) 1** Instead of using + /// $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' + /// "** When dimension name is **dim (test) 3** and dimension value is **dim3 + /// (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " + /// use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** /// /// /// Allows retrieving only metadata of the baseline. On data request all @@ -119,6 +124,13 @@ internal BaselinesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -142,7 +154,7 @@ internal BaselinesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metricBaselines").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/metricBaselines").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); List _queryParameters = new List(); if (metricnames != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperationsExtensions.cs index dadeb22767847..3fa0170b488fa 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperationsExtensions.cs @@ -33,7 +33,9 @@ public static partial class BaselinesOperationsExtensions /// The identifier of the resource. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special case: If a + /// metricname itself has a comma in it then use %2 to indicate it. Eg: + /// 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// Metric namespace to query metric definitions for. @@ -52,17 +54,20 @@ public static partial class BaselinesOperationsExtensions /// The list of sensitivities (comma separated) to retrieve. /// /// - /// The **$filter** is used to reduce the set of metric data - /// returned.<br>Example:<br>Metric contains metadata A, B and - /// C.<br>- Return all time series of C where A = a1 and B = b1 or - /// b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq - /// ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq - /// ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the - /// logical or operator cannot separate two different metadata - /// names.<br>- Return all time series where A = a1, B = b1 and C = - /// c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- - /// Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq - /// ‘*’ and C eq ‘*’**. + /// The **$filter** is used to reduce the set of metric data returned. Example: + /// Metric contains metadata A, B and C. - Return all time series of C where A + /// = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C + /// eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' + /// or B = 'b2'** This is invalid because the logical or operator cannot + /// separate two different metadata names. - Return all time series where A = + /// a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - + /// Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C + /// eq '*'**. Special case: When dimension name or dimension value uses round + /// brackets. Eg: When dimension name is **dim (test) 1** Instead of using + /// $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' + /// "** When dimension name is **dim (test) 3** and dimension value is **dim3 + /// (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " + /// use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** /// /// /// Allows retrieving only metadata of the baseline. On data request all @@ -83,7 +88,9 @@ public static partial class BaselinesOperationsExtensions /// The identifier of the resource. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special case: If a + /// metricname itself has a comma in it then use %2 to indicate it. Eg: + /// 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// Metric namespace to query metric definitions for. @@ -102,17 +109,20 @@ public static partial class BaselinesOperationsExtensions /// The list of sensitivities (comma separated) to retrieve. /// /// - /// The **$filter** is used to reduce the set of metric data - /// returned.<br>Example:<br>Metric contains metadata A, B and - /// C.<br>- Return all time series of C where A = a1 and B = b1 or - /// b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq - /// ‘*’**<br>- Invalid variant:<br>**$filter=A eq ‘a1’ and B eq - /// ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the - /// logical or operator cannot separate two different metadata - /// names.<br>- Return all time series where A = a1, B = b1 and C = - /// c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- - /// Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq - /// ‘*’ and C eq ‘*’**. + /// The **$filter** is used to reduce the set of metric data returned. Example: + /// Metric contains metadata A, B and C. - Return all time series of C where A + /// = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C + /// eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' + /// or B = 'b2'** This is invalid because the logical or operator cannot + /// separate two different metadata names. - Return all time series where A = + /// a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - + /// Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C + /// eq '*'**. Special case: When dimension name or dimension value uses round + /// brackets. Eg: When dimension name is **dim (test) 1** Instead of using + /// $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' + /// "** When dimension name is **dim (test) 3** and dimension value is **dim3 + /// (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " + /// use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** /// /// /// Allows retrieving only metadata of the baseline. On data request all diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionEndpointsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionEndpointsOperations.cs new file mode 100644 index 0000000000000..4150b01125373 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionEndpointsOperations.cs @@ -0,0 +1,1621 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataCollectionEndpointsOperations operations. + /// + internal partial class DataCollectionEndpointsOperations : IServiceOperations, IDataCollectionEndpointsOperations + { + /// + /// Initializes a new instance of the DataCollectionEndpointsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataCollectionEndpointsOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// Lists all data collection endpoints in the specified resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + string apiVersion = "2021-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.Insights/dataCollectionEndpoints").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all data collection endpoints in the specified subscription + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionEndpoints").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns the specified data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (dataCollectionEndpointName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionEndpointName"); + } + string apiVersion = "2021-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dataCollectionEndpointName", dataCollectionEndpointName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dataCollectionEndpointName}", System.Uri.EscapeDataString(dataCollectionEndpointName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// The payload + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionEndpointName, DataCollectionEndpointResource body = default(DataCollectionEndpointResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (dataCollectionEndpointName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionEndpointName"); + } + if (body != null) + { + body.Validate(); + } + string apiVersion = "2021-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dataCollectionEndpointName", dataCollectionEndpointName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", 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.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dataCollectionEndpointName}", System.Uri.EscapeDataString(dataCollectionEndpointName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + } + // 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) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates part of a data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// Resource tags. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionEndpointName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (dataCollectionEndpointName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionEndpointName"); + } + string apiVersion = "2021-04-01"; + ResourceForUpdate body = default(ResourceForUpdate); + if (tags != null) + { + body = new ResourceForUpdate(); + body.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dataCollectionEndpointName", dataCollectionEndpointName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); + 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.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dataCollectionEndpointName}", System.Uri.EscapeDataString(dataCollectionEndpointName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dataCollectionEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (dataCollectionEndpointName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionEndpointName"); + } + string apiVersion = "2021-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dataCollectionEndpointName", dataCollectionEndpointName); + 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.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dataCollectionEndpointName}", System.Uri.EscapeDataString(dataCollectionEndpointName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all data collection endpoints in the specified resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all data collection endpoints in the specified subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionEndpointsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionEndpointsOperationsExtensions.cs new file mode 100644 index 0000000000000..389a81bf64f50 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionEndpointsOperationsExtensions.cs @@ -0,0 +1,326 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataCollectionEndpointsOperations. + /// + public static partial class DataCollectionEndpointsOperationsExtensions + { + /// + /// Lists all data collection endpoints in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IPage ListByResourceGroup(this IDataCollectionEndpointsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection endpoints in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IDataCollectionEndpointsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all data collection endpoints in the specified subscription + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this IDataCollectionEndpointsOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection endpoints in the specified subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IDataCollectionEndpointsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns the specified data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + public static DataCollectionEndpointResource Get(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName) + { + return operations.GetAsync(resourceGroupName, dataCollectionEndpointName).GetAwaiter().GetResult(); + } + + /// + /// Returns the specified data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, dataCollectionEndpointName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// The payload + /// + public static DataCollectionEndpointResource Create(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName, DataCollectionEndpointResource body = default(DataCollectionEndpointResource)) + { + return operations.CreateAsync(resourceGroupName, dataCollectionEndpointName, body).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// The payload + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName, DataCollectionEndpointResource body = default(DataCollectionEndpointResource), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, dataCollectionEndpointName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates part of a data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// Resource tags. + /// + public static DataCollectionEndpointResource Update(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName, IDictionary tags = default(IDictionary)) + { + return operations.UpdateAsync(resourceGroupName, dataCollectionEndpointName, tags).GetAwaiter().GetResult(); + } + + /// + /// Updates part of a data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// Resource tags. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, dataCollectionEndpointName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + public static void Delete(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName) + { + operations.DeleteAsync(resourceGroupName, dataCollectionEndpointName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a data collection endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataCollectionEndpointsOperations operations, string resourceGroupName, string dataCollectionEndpointName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dataCollectionEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all data collection endpoints in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IDataCollectionEndpointsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection endpoints in the specified 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 IDataCollectionEndpointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all data collection endpoints in the specified subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IDataCollectionEndpointsOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection endpoints in the specified 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 IDataCollectionEndpointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsExtensions.cs deleted file mode 100644 index cb5e017e2e08e..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsExtensions.cs +++ /dev/null @@ -1,217 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Models; - - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DataCollectionRuleAssociations. - /// - public static partial class DataCollectionRuleAssociationsExtensions - { - /// - /// Lists associations for the specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - public static Page ListByResource(this IDataCollectionRuleAssociations operations, string resourceUri) - { - return operations.ListByResourceAsync(resourceUri).GetAwaiter().GetResult(); - } - - /// - /// Lists associations for the specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceAsync(this IDataCollectionRuleAssociations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists associations for the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - public static Page ListByRule(this IDataCollectionRuleAssociations operations, string resourceGroupName, string dataCollectionRuleName) - { - return operations.ListByRuleAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Lists associations for the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByRuleAsync(this IDataCollectionRuleAssociations operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByRuleWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the specified association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - public static DataCollectionRuleAssociationProxyOnlyResource Get(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName) - { - return operations.GetAsync(resourceUri, associationName).GetAwaiter().GetResult(); - } - - /// - /// Returns the specified association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, associationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The payload - /// - public static DataCollectionRuleAssociationProxyOnlyResource Create(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource)) - { - return operations.CreateAsync(resourceUri, associationName, body).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The payload - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceUri, associationName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - public static void Delete(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName) - { - operations.DeleteAsync(resourceUri, associationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceUri, associationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsOperations.cs similarity index 60% rename from sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs rename to sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsOperations.cs index 4fae9f9b9192a..c24764de2fbc4 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -7,14 +11,11 @@ namespace Microsoft.Azure.Management.Monitor { using Microsoft.Rest; - + using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -22,12 +23,12 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// DataCollectionRuleAssociations operations. + /// DataCollectionRuleAssociationsOperations operations. /// - public partial class DataCollectionRuleAssociations : IServiceOperations, IDataCollectionRuleAssociations + internal partial class DataCollectionRuleAssociationsOperations : IServiceOperations, IDataCollectionRuleAssociationsOperations { /// - /// Initializes a new instance of the DataCollectionRuleAssociations class. + /// Initializes a new instance of the DataCollectionRuleAssociationsOperations class. /// /// /// Reference to the service client. @@ -35,7 +36,7 @@ public partial class DataCollectionRuleAssociations : IServiceOperations /// Thrown when a required parameter is null /// - public DataCollectionRuleAssociations(MonitorManagementClient client) + internal DataCollectionRuleAssociationsOperations(MonitorManagementClient client) { if (client == null) { @@ -61,7 +62,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,7 +77,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { @@ -89,7 +90,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); } } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -113,7 +114,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -121,11 +122,23 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -159,11 +172,11 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -187,9 +200,13 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse>(); + var _result = new AzureOperationResponse>(); _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) { @@ -230,7 +247,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -245,7 +262,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -272,31 +289,12 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (dataCollectionRuleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -323,7 +321,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -331,11 +329,23 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -369,11 +379,11 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -397,9 +407,13 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse>(); + var _result = new AzureOperationResponse>(); _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) { @@ -432,7 +446,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// The identifier of the resource. /// /// - /// The name of the association. + /// The name of the association. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -440,7 +454,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -455,7 +469,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { @@ -472,22 +486,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "associationName"); } - if (associationName != null) - { - if (associationName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "associationName", 64); - } - if (associationName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "associationName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(associationName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "associationName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -513,7 +512,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -521,11 +520,23 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -559,11 +570,11 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -587,9 +598,13 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new AzureOperationResponse(); _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) { @@ -622,7 +637,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// The identifier of the resource. /// /// - /// The name of the association. + /// The name of the association. The name is case insensitive. /// /// /// The payload @@ -633,7 +648,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -648,7 +663,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { @@ -665,26 +680,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "associationName"); } - if (associationName != null) - { - if (associationName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "associationName", 64); - } - if (associationName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "associationName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(associationName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "associationName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (body != null) - { - body.Validate(); - } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -711,7 +707,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -719,11 +715,23 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -735,11 +743,11 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) // Serialize Request string _requestContent = null; - if (body != null) + if(body != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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"); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) @@ -763,11 +771,11 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -791,9 +799,13 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new AzureOperationResponse(); _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) { @@ -844,7 +856,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// The identifier of the resource. /// /// - /// The name of the association. + /// The name of the association. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -852,7 +864,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -864,7 +876,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { @@ -881,22 +893,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "associationName"); } - if (associationName != null) - { - if (associationName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "associationName", 64); - } - if (associationName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "associationName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(associationName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "associationName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -922,7 +919,7 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -930,11 +927,23 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -968,11 +977,11 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -996,9 +1005,349 @@ public DataCollectionRuleAssociations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists associations for the specified resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists associations for the specified data collection rule. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByRuleNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByRuleNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsOperationsExtensions.cs new file mode 100644 index 0000000000000..df1024a00119a --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsOperationsExtensions.cs @@ -0,0 +1,290 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataCollectionRuleAssociationsOperations. + /// + public static partial class DataCollectionRuleAssociationsOperationsExtensions + { + /// + /// Lists associations for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + public static IPage ListByResource(this IDataCollectionRuleAssociationsOperations operations, string resourceUri) + { + return operations.ListByResourceAsync(resourceUri).GetAwaiter().GetResult(); + } + + /// + /// Lists associations for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceAsync(this IDataCollectionRuleAssociationsOperations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists associations for the specified data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + public static IPage ListByRule(this IDataCollectionRuleAssociationsOperations operations, string resourceGroupName, string dataCollectionRuleName) + { + return operations.ListByRuleAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); + } + + /// + /// Lists associations for the specified data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByRuleAsync(this IDataCollectionRuleAssociationsOperations operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByRuleWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns the specified association. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The name of the association. The name is case insensitive. + /// + public static DataCollectionRuleAssociationProxyOnlyResource Get(this IDataCollectionRuleAssociationsOperations operations, string resourceUri, string associationName) + { + return operations.GetAsync(resourceUri, associationName).GetAwaiter().GetResult(); + } + + /// + /// Returns the specified association. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The name of the association. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataCollectionRuleAssociationsOperations operations, string resourceUri, string associationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, associationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an association. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The name of the association. The name is case insensitive. + /// + /// + /// The payload + /// + public static DataCollectionRuleAssociationProxyOnlyResource Create(this IDataCollectionRuleAssociationsOperations operations, string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource)) + { + return operations.CreateAsync(resourceUri, associationName, body).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an association. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The name of the association. The name is case insensitive. + /// + /// + /// The payload + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IDataCollectionRuleAssociationsOperations operations, string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceUri, associationName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an association. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The name of the association. The name is case insensitive. + /// + public static void Delete(this IDataCollectionRuleAssociationsOperations operations, string resourceUri, string associationName) + { + operations.DeleteAsync(resourceUri, associationName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an association. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The name of the association. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataCollectionRuleAssociationsOperations operations, string resourceUri, string associationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceUri, associationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists associations for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceNext(this IDataCollectionRuleAssociationsOperations operations, string nextPageLink) + { + return operations.ListByResourceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists associations for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceNextAsync(this IDataCollectionRuleAssociationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists associations for the specified data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByRuleNext(this IDataCollectionRuleAssociationsOperations operations, string nextPageLink) + { + return operations.ListByRuleNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists associations for the specified data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByRuleNextAsync(this IDataCollectionRuleAssociationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByRuleNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesExtensions.cs deleted file mode 100644 index 1c443c8cbf1aa..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesExtensions.cs +++ /dev/null @@ -1,251 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Models; - - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DataCollectionRules. - /// - public static partial class DataCollectionRulesExtensions - { - /// - /// Lists all data collection rules in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static Page ListByResourceGroup(this IDataCollectionRules operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all data collection rules in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDataCollectionRules operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all data collection rules in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - public static Page ListBySubscription(this IDataCollectionRules operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all data collection rules in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IDataCollectionRules operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - public static DataCollectionRuleResource Get(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName) - { - return operations.GetAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Returns the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - public static DataCollectionRuleResource Create(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource)) - { - return operations.CreateAsync(resourceGroupName, dataCollectionRuleName, body).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates part of a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - public static DataCollectionRuleResource Update(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate)) - { - return operations.UpdateAsync(resourceGroupName, dataCollectionRuleName, body).GetAwaiter().GetResult(); - } - - /// - /// Updates part of a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - public static void Delete(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName) - { - operations.DeleteAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesOperations.cs similarity index 65% rename from sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs rename to sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesOperations.cs index 8b5de5f0a032a..adbefd834ebfa 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -7,14 +11,11 @@ namespace Microsoft.Azure.Management.Monitor { using Microsoft.Rest; - + using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -22,12 +23,12 @@ namespace Microsoft.Azure.Management.Monitor using System.Threading.Tasks; /// - /// DataCollectionRules operations. + /// DataCollectionRulesOperations operations. /// - public partial class DataCollectionRules : IServiceOperations, IDataCollectionRules + internal partial class DataCollectionRulesOperations : IServiceOperations, IDataCollectionRulesOperations { /// - /// Initializes a new instance of the DataCollectionRules class. + /// Initializes a new instance of the DataCollectionRulesOperations class. /// /// /// Reference to the service client. @@ -35,7 +36,7 @@ public partial class DataCollectionRules : IServiceOperations /// Thrown when a required parameter is null /// - public DataCollectionRules(MonitorManagementClient client) + internal DataCollectionRulesOperations(MonitorManagementClient client) { if (client == null) { @@ -61,7 +62,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,7 +77,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -103,12 +104,8 @@ public DataCollectionRules(MonitorManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -133,7 +130,7 @@ public DataCollectionRules(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -141,11 +138,23 @@ public DataCollectionRules(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -179,11 +188,11 @@ public DataCollectionRules(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -207,9 +216,13 @@ public DataCollectionRules(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse>(); + var _result = new AzureOperationResponse>(); _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) { @@ -244,7 +257,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -259,7 +272,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -272,7 +285,7 @@ public DataCollectionRules(MonitorManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +308,7 @@ public DataCollectionRules(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -303,11 +316,23 @@ public DataCollectionRules(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -341,11 +366,11 @@ public DataCollectionRules(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -369,9 +394,13 @@ public DataCollectionRules(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse>(); + var _result = new AzureOperationResponse>(); _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) { @@ -412,7 +441,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -427,7 +456,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -454,31 +483,12 @@ public DataCollectionRules(MonitorManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (dataCollectionRuleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +515,7 @@ public DataCollectionRules(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -513,11 +523,23 @@ public DataCollectionRules(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -551,11 +573,11 @@ public DataCollectionRules(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -579,9 +601,13 @@ public DataCollectionRules(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new AzureOperationResponse(); _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) { @@ -625,7 +651,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -640,7 +666,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -667,35 +693,16 @@ public DataCollectionRules(MonitorManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (dataCollectionRuleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } if (body != null) { body.Validate(); } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -723,7 +730,7 @@ public DataCollectionRules(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -731,11 +738,23 @@ public DataCollectionRules(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -747,11 +766,11 @@ public DataCollectionRules(MonitorManagementClient client) // Serialize Request string _requestContent = null; - if (body != null) + if(body != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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"); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) @@ -775,11 +794,11 @@ public DataCollectionRules(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -803,9 +822,13 @@ public DataCollectionRules(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new AzureOperationResponse(); _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) { @@ -858,8 +881,8 @@ public DataCollectionRules(MonitorManagementClient client) /// /// The name of the data collection rule. The name is case insensitive. /// - /// - /// The payload + /// + /// Resource tags. /// /// /// Headers that will be added to request. @@ -867,7 +890,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -882,7 +905,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -909,31 +932,18 @@ public DataCollectionRules(MonitorManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (dataCollectionRuleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); } - if (dataCollectionRuleName != null) + string apiVersion = "2021-04-01"; + ResourceForUpdate body = default(ResourceForUpdate); + if (tags != null) { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } + body = new ResourceForUpdate(); + body.Tags = tags; } - string apiVersion = "2019-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -961,7 +971,7 @@ public DataCollectionRules(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -969,11 +979,23 @@ public DataCollectionRules(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -985,11 +1007,11 @@ public DataCollectionRules(MonitorManagementClient client) // Serialize Request string _requestContent = null; - if (body != null) + if(body != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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"); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) @@ -1013,11 +1035,11 @@ public DataCollectionRules(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1041,9 +1063,13 @@ public DataCollectionRules(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new AzureOperationResponse(); _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) { @@ -1084,7 +1110,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1096,7 +1122,7 @@ public DataCollectionRules(MonitorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1123,31 +1149,12 @@ public DataCollectionRules(MonitorManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (dataCollectionRuleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; + string apiVersion = "2021-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1174,7 +1181,7 @@ public DataCollectionRules(MonitorManagementClient client) } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -1182,11 +1189,23 @@ public DataCollectionRules(MonitorManagementClient client) _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } if (customHeaders != null) { - foreach (var _header in customHeaders) + foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { @@ -1220,11 +1239,11 @@ public DataCollectionRules(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1248,9 +1267,349 @@ public DataCollectionRules(MonitorManagementClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all data collection rules in the specified resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all data collection rules in the specified subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseCommonV2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseCommonV2 _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesOperationsExtensions.cs new file mode 100644 index 0000000000000..8bf982fa52133 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesOperationsExtensions.cs @@ -0,0 +1,326 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataCollectionRulesOperations. + /// + public static partial class DataCollectionRulesOperationsExtensions + { + /// + /// Lists all data collection rules in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IPage ListByResourceGroup(this IDataCollectionRulesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection rules in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IDataCollectionRulesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all data collection rules in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this IDataCollectionRulesOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection rules in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IDataCollectionRulesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns the specified data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + public static DataCollectionRuleResource Get(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName) + { + return operations.GetAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); + } + + /// + /// Returns the specified data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + /// + /// The payload + /// + public static DataCollectionRuleResource Create(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource)) + { + return operations.CreateAsync(resourceGroupName, dataCollectionRuleName, body).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + /// + /// The payload + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates part of a data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + /// + /// Resource tags. + /// + public static DataCollectionRuleResource Update(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName, IDictionary tags = default(IDictionary)) + { + return operations.UpdateAsync(resourceGroupName, dataCollectionRuleName, tags).GetAwaiter().GetResult(); + } + + /// + /// Updates part of a data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + /// + /// Resource tags. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + public static void Delete(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName) + { + operations.DeleteAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a data collection rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataCollectionRulesOperations operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all data collection rules in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IDataCollectionRulesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection rules in the specified 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 IDataCollectionRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all data collection rules in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IDataCollectionRulesOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all data collection rules in the specified 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 IDataCollectionRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsCategoryOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsCategoryOperations.cs index 7869144306cc0..f0b000fd7f877 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsCategoryOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsCategoryOperations.cs @@ -86,6 +86,13 @@ internal DiagnosticSettingsCategoryOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); @@ -106,7 +113,7 @@ internal DiagnosticSettingsCategoryOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); @@ -267,6 +274,13 @@ internal DiagnosticSettingsCategoryOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } string apiVersion = "2017-05-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -282,7 +296,7 @@ internal DiagnosticSettingsCategoryOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); List _queryParameters = new List(); if (apiVersion != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsOperations.cs index edfc46a301d81..b16ebdf6b4c2b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DiagnosticSettingsOperations.cs @@ -86,6 +86,13 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); @@ -106,7 +113,7 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); @@ -273,6 +280,13 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -298,7 +312,7 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); @@ -465,6 +479,13 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); @@ -485,7 +506,7 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); @@ -628,6 +649,13 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } string apiVersion = "2017-05-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -643,7 +671,7 @@ internal DiagnosticSettingsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/diagnosticSettings").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); List _queryParameters = new List(); if (apiVersion != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/EventCategoriesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/EventCategoriesOperations.cs index d4fa28f572263..e5b727c56c848 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/EventCategoriesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/EventCategoriesOperations.cs @@ -86,7 +86,7 @@ internal EventCategoriesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventcategories").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Insights/eventcategories").ToString(); List _queryParameters = new List(); if (apiVersion != null) { diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActionGroupsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActionGroupsOperations.cs index 9e85c5659aa7c..3294d6b5194ea 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActionGroupsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActionGroupsOperations.cs @@ -27,7 +27,7 @@ public partial interface IActionGroupsOperations /// Create a new action group or update an existing one. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -55,7 +55,7 @@ public partial interface IActionGroupsOperations /// Get an action group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -80,7 +80,7 @@ public partial interface IActionGroupsOperations /// Delete an action group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -103,7 +103,7 @@ public partial interface IActionGroupsOperations /// the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. @@ -150,7 +150,7 @@ public partial interface IActionGroupsOperations /// Get a list of all action groups in a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -174,7 +174,7 @@ public partial interface IActionGroupsOperations /// for Email or SMS receivers. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the action group. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActivityLogAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActivityLogAlertsOperations.cs index 5244dcac59f8e..21a14f9e9f9fa 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActivityLogAlertsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IActivityLogAlertsOperations.cs @@ -27,7 +27,7 @@ public partial interface IActivityLogAlertsOperations /// Create a new activity log alert or update an existing one. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -55,7 +55,7 @@ public partial interface IActivityLogAlertsOperations /// Get an activity log alert. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -80,7 +80,7 @@ public partial interface IActivityLogAlertsOperations /// Delete an activity log alert. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -103,7 +103,7 @@ public partial interface IActivityLogAlertsOperations /// other fields use the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the activity log alert. @@ -150,7 +150,7 @@ public partial interface IActivityLogAlertsOperations /// Get a list of all activity log alerts in a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRuleIncidentsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRuleIncidentsOperations.cs index 8a77a721de282..14f9273597794 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRuleIncidentsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRuleIncidentsOperations.cs @@ -27,7 +27,7 @@ public partial interface IAlertRuleIncidentsOperations /// Gets an incident associated to an alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -55,7 +55,7 @@ public partial interface IAlertRuleIncidentsOperations /// Gets a list of incidents associated to an alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs index 9a365ee836ed7..8cb6ba8bf33cd 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs @@ -27,7 +27,7 @@ public partial interface IAlertRulesOperations /// Creates or updates a classic metric alert rule. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -55,7 +55,7 @@ public partial interface IAlertRulesOperations /// Deletes a classic metric alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -66,7 +66,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,7 +77,7 @@ public partial interface IAlertRulesOperations /// Gets a classic metric alert rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -88,7 +88,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -103,7 +103,7 @@ public partial interface IAlertRulesOperations /// other fields use the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -131,7 +131,7 @@ public partial interface IAlertRulesOperations /// List the classic metric alert rules within a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -139,7 +139,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -158,7 +158,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAutoscaleSettingsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAutoscaleSettingsOperations.cs index f19a2533a7880..1b889a9580705 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAutoscaleSettingsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAutoscaleSettingsOperations.cs @@ -27,7 +27,7 @@ public partial interface IAutoscaleSettingsOperations /// Lists the autoscale settings for a resource group /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -49,7 +49,7 @@ public partial interface IAutoscaleSettingsOperations /// Creates or updates an autoscale setting. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -77,7 +77,7 @@ public partial interface IAutoscaleSettingsOperations /// Deletes and autoscale setting /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -99,7 +99,7 @@ public partial interface IAutoscaleSettingsOperations /// Gets an autoscale setting /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. @@ -125,7 +125,7 @@ public partial interface IAutoscaleSettingsOperations /// fields use the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The autoscale setting name. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IBaselinesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IBaselinesOperations.cs index 065deca8f8eeb..5a76f0c09ee88 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IBaselinesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IBaselinesOperations.cs @@ -30,7 +30,9 @@ public partial interface IBaselinesOperations /// The identifier of the resource. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special + /// case: If a metricname itself has a comma in it then use %2 to + /// indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// Metric namespace to query metric definitions for. @@ -49,17 +51,22 @@ public partial interface IBaselinesOperations /// The list of sensitivities (comma separated) to retrieve. /// /// - /// The **$filter** is used to reduce the set of metric data - /// returned.<br>Example:<br>Metric contains metadata A, B - /// and C.<br>- Return all time series of C where A = a1 and B = - /// b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ - /// and C eq ‘*’**<br>- Invalid variant:<br>**$filter=A eq - /// ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is - /// invalid because the logical or operator cannot separate two - /// different metadata names.<br>- Return all time series where A - /// = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ - /// and C eq ‘c1’**<br>- Return all time series where A = - /// a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + /// The **$filter** is used to reduce the set of metric data returned. + /// Example: Metric contains metadata A, B and C. - Return all time + /// series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B + /// eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A + /// eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid + /// because the logical or operator cannot separate two different + /// metadata names. - Return all time series where A = a1, B = b1 and C + /// = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return + /// all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C + /// eq '*'**. Special case: When dimension name or dimension value uses + /// round brackets. Eg: When dimension name is **dim (test) 1** Instead + /// of using $filter= "dim (test) 1 eq '*' " use **$filter= "dim + /// %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** + /// and dimension value is **dim3 (test) val** Instead of using + /// $filter= "dim (test) 3 eq 'dim3 (test) val' " use **$filter= "dim + /// %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** /// /// /// Allows retrieving only metadata of the baseline. On data request diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionEndpointsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionEndpointsOperations.cs new file mode 100644 index 0000000000000..a8b09bbc839b6 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionEndpointsOperations.cs @@ -0,0 +1,221 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataCollectionEndpointsOperations operations. + /// + public partial interface IDataCollectionEndpointsOperations + { + /// + /// Lists all data collection endpoints in the specified resource + /// group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all data collection endpoints in the specified 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns the specified data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case + /// insensitive. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case + /// insensitive. + /// + /// + /// The payload + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionEndpointName, DataCollectionEndpointResource body = default(DataCollectionEndpointResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates part of a data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case + /// insensitive. + /// + /// + /// Resource tags. + /// + /// + /// 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 dataCollectionEndpointName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a data collection endpoint. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the data collection endpoint. The name is case + /// insensitive. + /// + /// + /// 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 dataCollectionEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all data collection endpoints in the specified 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all data collection endpoints in the specified 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociationsOperations.cs similarity index 51% rename from sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs rename to sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociationsOperations.cs index cdceddf6a90a9..8ce21474f167a 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociationsOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -7,18 +11,17 @@ namespace Microsoft.Azure.Management.Monitor { using Microsoft.Rest; - + using Microsoft.Rest.Azure; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; /// - /// DataCollectionRuleAssociations operations. + /// DataCollectionRuleAssociationsOperations operations. /// - public partial interface IDataCollectionRuleAssociations + public partial interface IDataCollectionRuleAssociationsOperations { /// /// Lists associations for the specified resource. @@ -32,7 +35,7 @@ public partial interface IDataCollectionRuleAssociations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -41,7 +44,7 @@ public partial interface IDataCollectionRuleAssociations /// /// Thrown when a required parameter is null /// - Task>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists associations for the specified data collection rule. /// @@ -57,7 +60,7 @@ public partial interface IDataCollectionRuleAssociations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -66,7 +69,7 @@ public partial interface IDataCollectionRuleAssociations /// /// Thrown when a required parameter is null /// - Task>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns the specified association. /// @@ -74,7 +77,7 @@ public partial interface IDataCollectionRuleAssociations /// The identifier of the resource. /// /// - /// The name of the association. + /// The name of the association. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -82,7 +85,7 @@ public partial interface IDataCollectionRuleAssociations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -91,7 +94,7 @@ public partial interface IDataCollectionRuleAssociations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates an association. /// @@ -99,7 +102,7 @@ public partial interface IDataCollectionRuleAssociations /// The identifier of the resource. /// /// - /// The name of the association. + /// The name of the association. The name is case insensitive. /// /// /// The payload @@ -110,7 +113,7 @@ public partial interface IDataCollectionRuleAssociations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -119,7 +122,7 @@ public partial interface IDataCollectionRuleAssociations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an association. /// @@ -127,7 +130,48 @@ public partial interface IDataCollectionRuleAssociations /// The identifier of the resource. /// /// - /// The name of the association. + /// The name of the association. The name is case insensitive. + /// + /// + /// 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 resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists associations for the specified resource. + /// + /// + /// 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>> ListByResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists associations for the specified data collection rule. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -135,12 +179,15 @@ public partial interface IDataCollectionRuleAssociations /// /// 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 resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByRuleNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRulesOperations.cs similarity index 56% rename from sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs rename to sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRulesOperations.cs index 1002215a1d476..5f7f6a6b7a920 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRulesOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -7,18 +11,17 @@ namespace Microsoft.Azure.Management.Monitor { using Microsoft.Rest; - + using Microsoft.Rest.Azure; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; /// - /// DataCollectionRules operations. + /// DataCollectionRulesOperations operations. /// - public partial interface IDataCollectionRules + public partial interface IDataCollectionRulesOperations { /// /// Lists all data collection rules in the specified resource group. @@ -32,7 +35,7 @@ public partial interface IDataCollectionRules /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -41,7 +44,7 @@ public partial interface IDataCollectionRules /// /// Thrown when a required parameter is null /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all data collection rules in the specified subscription. /// @@ -51,7 +54,7 @@ public partial interface IDataCollectionRules /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -60,7 +63,7 @@ public partial interface IDataCollectionRules /// /// Thrown when a required parameter is null /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns the specified data collection rule. /// @@ -76,7 +79,7 @@ public partial interface IDataCollectionRules /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -85,7 +88,7 @@ public partial interface IDataCollectionRules /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates a data collection rule. /// @@ -104,7 +107,7 @@ public partial interface IDataCollectionRules /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -113,7 +116,7 @@ public partial interface IDataCollectionRules /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates part of a data collection rule. /// @@ -123,8 +126,8 @@ public partial interface IDataCollectionRules /// /// The name of the data collection rule. The name is case insensitive. /// - /// - /// The payload + /// + /// Resource tags. /// /// /// The headers that will be added to request. @@ -132,7 +135,7 @@ public partial interface IDataCollectionRules /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -141,7 +144,7 @@ public partial interface IDataCollectionRules /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a data collection rule. /// @@ -157,12 +160,56 @@ public partial interface IDataCollectionRules /// /// The cancellation token. /// - /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all data collection rules in the specified 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all data collection rules in the specified 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs index ec52f97ca1dc8..9e357c1520d32 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs @@ -46,7 +46,7 @@ public partial interface IMetricAlertsOperations /// Retrieve alert rule definitions in a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -68,7 +68,7 @@ public partial interface IMetricAlertsOperations /// Retrieve an alert rule definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -93,7 +93,7 @@ public partial interface IMetricAlertsOperations /// Create or update an metric alert definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -121,7 +121,7 @@ public partial interface IMetricAlertsOperations /// Update an metric alert definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -149,7 +149,7 @@ public partial interface IMetricAlertsOperations /// Delete an alert rule definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -160,7 +160,7 @@ public partial interface IMetricAlertsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsStatusOperations.cs index 292c2a96a8d3f..3974fcf5e51e6 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsStatusOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsStatusOperations.cs @@ -27,7 +27,7 @@ public partial interface IMetricAlertsStatusOperations /// Retrieve an alert rule status. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -52,7 +52,7 @@ public partial interface IMetricAlertsStatusOperations /// Retrieve an alert rule status. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricBaselineOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricBaselineOperations.cs deleted file mode 100644 index fa417ecdba123..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricBaselineOperations.cs +++ /dev/null @@ -1,102 +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.Monitor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// MetricBaselineOperations operations. - /// - public partial interface IMetricBaselineOperations - { - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request - /// all information is retrieved. Possible values include: 'Data', - /// 'Metadata' - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// Information that need to be specified to calculate a baseline on a - /// time series. - /// - /// - /// 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> CalculateBaselineWithHttpMessagesAsync(string resourceUri, TimeSeriesInformation timeSeriesInformation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricsOperations.cs index 1058e9de10188..26e01b9e62b25 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricsOperations.cs @@ -41,7 +41,9 @@ public partial interface IMetricsOperations /// The interval (i.e. timegrain) of the query. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special + /// case: If a metricname itself has a comma in it then use %2 to + /// indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// The list of aggregation types (comma separated) to retrieve. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs index dc566c7a40578..6c5edd9b2b6d3 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs @@ -41,7 +41,7 @@ public partial interface IMonitorManagementClient : System.IDisposable ServiceClientCredentials Credentials { get; } /// - /// The Azure subscription Id. + /// The ID of the target subscription. /// string SubscriptionId { get; set; } @@ -104,11 +104,6 @@ public partial interface IMonitorManagementClient : System.IDisposable /// IActionGroupsOperations ActionGroups { get; } - /// - /// Gets the IActivityLogAlertsOperations. - /// - IActivityLogAlertsOperations ActivityLogAlerts { get; } - /// /// Gets the IActivityLogsOperations. /// @@ -134,11 +129,6 @@ public partial interface IMonitorManagementClient : System.IDisposable /// IMetricsOperations Metrics { get; } - /// - /// Gets the IMetricBaselineOperations. - /// - IMetricBaselineOperations MetricBaseline { get; } - /// /// Gets the IBaselinesOperations. /// @@ -195,13 +185,24 @@ public partial interface IMonitorManagementClient : System.IDisposable IPrivateLinkScopedResourcesOperations PrivateLinkScopedResources { get; } /// - /// Gets the IDataCollectionRules. + /// Gets the IActivityLogAlertsOperations. /// - IDataCollectionRules DataCollectionRules { get; } + IActivityLogAlertsOperations ActivityLogAlerts { get; } + + /// + /// Gets the IDataCollectionEndpointsOperations. + /// + IDataCollectionEndpointsOperations DataCollectionEndpoints { get; } /// - /// Gets the IDataCollectionRuleAssociations. + /// Gets the IDataCollectionRuleAssociationsOperations. /// - IDataCollectionRuleAssociations DataCollectionRuleAssociations { get; } + IDataCollectionRuleAssociationsOperations DataCollectionRuleAssociations { get; } + + /// + /// Gets the IDataCollectionRulesOperations. + /// + IDataCollectionRulesOperations DataCollectionRules { get; } + } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateEndpointConnectionsOperations.cs index a7ba557f35670..8c1c483472cea 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateEndpointConnectionsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -27,7 +27,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// Gets a private endpoint connection. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -55,7 +55,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -85,7 +85,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -110,7 +110,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// Gets all private endpoint connections on a private link scope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -135,7 +135,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -165,7 +165,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkResourcesOperations.cs index 0f99e2a8db8cb..75f9697b3ae9c 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkResourcesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkResourcesOperations.cs @@ -28,7 +28,7 @@ public partial interface IPrivateLinkResourcesOperations /// Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -54,7 +54,7 @@ public partial interface IPrivateLinkResourcesOperations /// Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopeOperationStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopeOperationStatusOperations.cs index 45e67dbd6f896..572210155e680 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopeOperationStatusOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopeOperationStatusOperations.cs @@ -31,7 +31,7 @@ public partial interface IPrivateLinkScopeOperationStatusOperations /// The operation Id. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopedResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopedResourcesOperations.cs index 5e9aae6b02e5e..9d78062ea7b6b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopedResourcesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopedResourcesOperations.cs @@ -27,7 +27,7 @@ public partial interface IPrivateLinkScopedResourcesOperations /// Gets a scoped resource in a private link scope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -55,7 +55,7 @@ public partial interface IPrivateLinkScopedResourcesOperations /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -86,7 +86,7 @@ public partial interface IPrivateLinkScopedResourcesOperations /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -111,7 +111,7 @@ public partial interface IPrivateLinkScopedResourcesOperations /// Gets all private endpoint connections on a private link scope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -136,7 +136,7 @@ public partial interface IPrivateLinkScopedResourcesOperations /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -167,7 +167,7 @@ public partial interface IPrivateLinkScopedResourcesOperations /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopesOperations.cs index 764f73ca2ff60..35aa285c547f3 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopesOperations.cs @@ -48,7 +48,7 @@ public partial interface IPrivateLinkScopesOperations /// group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -70,7 +70,7 @@ public partial interface IPrivateLinkScopesOperations /// Deletes a Azure Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -92,7 +92,7 @@ public partial interface IPrivateLinkScopesOperations /// Returns a Azure Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -119,7 +119,7 @@ public partial interface IPrivateLinkScopesOperations /// in the Put operation. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -149,7 +149,7 @@ public partial interface IPrivateLinkScopesOperations /// use the CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -177,7 +177,7 @@ public partial interface IPrivateLinkScopesOperations /// Deletes a Azure Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs index ba4456ae5c1e9..2c059ed508f32 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs @@ -28,7 +28,7 @@ public partial interface IScheduledQueryRulesOperations /// Creates or updates an log search rule. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -42,7 +42,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -56,7 +56,7 @@ public partial interface IScheduledQueryRulesOperations /// Gets an Log Search rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -67,7 +67,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -81,7 +81,7 @@ public partial interface IScheduledQueryRulesOperations /// Update log search Rule. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -95,7 +95,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -109,7 +109,7 @@ public partial interface IScheduledQueryRulesOperations /// Deletes a Log Search rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -120,7 +120,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -139,7 +139,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -153,7 +153,7 @@ public partial interface IScheduledQueryRulesOperations /// List the Log Search rules within a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// OData parameters to apply to the operation. @@ -164,7 +164,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs index 22c26c0894b2c..a4dab2af3eb2b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs @@ -84,6 +84,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -99,7 +106,7 @@ internal LogProfilesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}").ToString(); _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -251,6 +258,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -266,7 +280,7 @@ internal LogProfilesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}").ToString(); _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -442,6 +456,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -458,7 +479,7 @@ internal LogProfilesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}").ToString(); _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -634,6 +655,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (logProfileName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "logProfileName"); @@ -658,7 +686,7 @@ internal LogProfilesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); List _queryParameters = new List(); @@ -822,6 +850,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -836,7 +871,7 @@ internal LogProfilesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs index 212520cb0f36c..8cfc972860746 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs @@ -80,6 +80,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -225,7 +232,7 @@ internal MetricAlertsOperations(MonitorManagementClient client) /// Retrieve alert rule definitions in a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -254,10 +261,28 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } string apiVersion = "2018-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -405,7 +430,7 @@ internal MetricAlertsOperations(MonitorManagementClient client) /// Retrieve an alert rule definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -437,10 +462,28 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -594,7 +637,7 @@ internal MetricAlertsOperations(MonitorManagementClient client) /// Create or update an metric alert definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -629,10 +672,28 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -801,7 +862,7 @@ internal MetricAlertsOperations(MonitorManagementClient client) /// Update an metric alert definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -836,10 +897,28 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -1004,7 +1083,7 @@ internal MetricAlertsOperations(MonitorManagementClient client) /// Delete an alert rule definition. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -1015,7 +1094,7 @@ internal MetricAlertsOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1033,10 +1112,28 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -1126,14 +1223,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - 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; } } @@ -1143,10 +1239,6 @@ internal MetricAlertsOperations(MonitorManagementClient 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/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperationsExtensions.cs index 9f8e6f9968a54..7784b60e9ce00 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperationsExtensions.cs @@ -58,7 +58,7 @@ public static IEnumerable ListBySubscription(this IMetricAl /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// public static IEnumerable ListByResourceGroup(this IMetricAlertsOperations operations, string resourceGroupName) { @@ -72,7 +72,7 @@ public static IEnumerable ListByResourceGroup(this IMetricA /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. @@ -92,7 +92,7 @@ public static IEnumerable ListByResourceGroup(this IMetricA /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -109,7 +109,7 @@ public static MetricAlertResource Get(this IMetricAlertsOperations operations, s /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -132,7 +132,7 @@ public static MetricAlertResource Get(this IMetricAlertsOperations operations, s /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -152,7 +152,7 @@ public static MetricAlertResource CreateOrUpdate(this IMetricAlertsOperations op /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -178,7 +178,7 @@ public static MetricAlertResource CreateOrUpdate(this IMetricAlertsOperations op /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -198,7 +198,7 @@ public static MetricAlertResource Update(this IMetricAlertsOperations operations /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -224,7 +224,7 @@ public static MetricAlertResource Update(this IMetricAlertsOperations operations /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -241,7 +241,7 @@ public static void Delete(this IMetricAlertsOperations operations, string resour /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs index 2fc747a557515..5f1a9a47b786e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs @@ -54,7 +54,7 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client) /// Retrieve an alert rule status. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -86,10 +86,28 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -243,7 +261,7 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client) /// Retrieve an alert rule status. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -278,10 +296,28 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperationsExtensions.cs index 9a5e5573db103..e5a74a13dd155 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperationsExtensions.cs @@ -28,7 +28,7 @@ public static partial class MetricAlertsStatusOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -45,7 +45,7 @@ public static MetricAlertStatusCollection List(this IMetricAlertsStatusOperation /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -68,7 +68,7 @@ public static MetricAlertStatusCollection List(this IMetricAlertsStatusOperation /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -88,7 +88,7 @@ public static MetricAlertStatusCollection ListByName(this IMetricAlertsStatusOpe /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs deleted file mode 100644 index 048ca649aaf3c..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs +++ /dev/null @@ -1,480 +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.Monitor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// MetricBaselineOperations operations. - /// - internal partial class MetricBaselineOperations : IServiceOperations, IMetricBaselineOperations - { - /// - /// Initializes a new instance of the MetricBaselineOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal MetricBaselineOperations(MonitorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the MonitorManagementClient - /// - public MonitorManagementClient Client { get; private set; } - - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request all - /// information is retrieved. Possible values include: 'Data', 'Metadata' - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (metricName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metricName"); - } - string apiVersion = "2017-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("metricName", metricName); - tracingParameters.Add("timespan", timespan); - tracingParameters.Add("interval", interval); - tracingParameters.Add("aggregation", aggregation); - tracingParameters.Add("sensitivities", sensitivities); - tracingParameters.Add("resultType", resultType); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/baseline/{metricName}").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{metricName}", System.Uri.EscapeDataString(metricName)); - List _queryParameters = new List(); - if (timespan != null) - { - _queryParameters.Add(string.Format("timespan={0}", System.Uri.EscapeDataString(timespan))); - } - if (interval != null) - { - _queryParameters.Add(string.Format("interval={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(interval, Client.SerializationSettings).Trim('"')))); - } - if (aggregation != null) - { - _queryParameters.Add(string.Format("aggregation={0}", System.Uri.EscapeDataString(aggregation))); - } - if (sensitivities != null) - { - _queryParameters.Add(string.Format("sensitivities={0}", System.Uri.EscapeDataString(sensitivities))); - } - if (resultType != null) - { - _queryParameters.Add(string.Format("resultType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(resultType, Client.SerializationSettings).Trim('"')))); - } - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// Information that need to be specified to calculate a baseline on a time - /// series. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CalculateBaselineWithHttpMessagesAsync(string resourceUri, TimeSeriesInformation timeSeriesInformation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (timeSeriesInformation == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "timeSeriesInformation"); - } - if (timeSeriesInformation != null) - { - timeSeriesInformation.Validate(); - } - string apiVersion = "2017-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("timeSeriesInformation", timeSeriesInformation); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CalculateBaseline", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/calculatebaseline").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(timeSeriesInformation != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(timeSeriesInformation, 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"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperationsExtensions.cs deleted file mode 100644 index 8cb8be9f89698..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperationsExtensions.cs +++ /dev/null @@ -1,153 +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.Monitor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for MetricBaselineOperations. - /// - public static partial class MetricBaselineOperationsExtensions - { - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request all - /// information is retrieved. Possible values include: 'Data', 'Metadata' - /// - public static BaselineResponse Get(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?)) - { - return operations.GetAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType).GetAwaiter().GetResult(); - } - - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request all - /// information is retrieved. Possible values include: 'Data', 'Metadata' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// Information that need to be specified to calculate a baseline on a time - /// series. - /// - public static CalculateBaselineResponse CalculateBaseline(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation) - { - return operations.CalculateBaselineAsync(resourceUri, timeSeriesInformation).GetAwaiter().GetResult(); - } - - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. It has the following structure: - /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - /// For example: - /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - /// - /// - /// Information that need to be specified to calculate a baseline on a time - /// series. - /// - /// - /// The cancellation token. - /// - public static async Task CalculateBaselineAsync(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CalculateBaselineWithHttpMessagesAsync(resourceUri, timeSeriesInformation, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricDefinitionsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricDefinitionsOperations.cs index d69e00083adc6..1666d28cf46e3 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricDefinitionsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricDefinitionsOperations.cs @@ -86,6 +86,13 @@ internal MetricDefinitionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -102,7 +109,7 @@ internal MetricDefinitionsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metricDefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/metricDefinitions").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); List _queryParameters = new List(); if (apiVersion != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricNamespacesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricNamespacesOperations.cs index 8e73a78d2a25c..26f99c8180159 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricNamespacesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricNamespacesOperations.cs @@ -87,6 +87,13 @@ internal MetricNamespacesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } string apiVersion = "2017-12-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperations.cs index d5a6702e129a4..ab85273033139 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperations.cs @@ -68,7 +68,9 @@ internal MetricsOperations(MonitorManagementClient client) /// The interval (i.e. timegrain) of the query. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special case: If a + /// metricname itself has a comma in it then use %2 to indicate it. Eg: + /// 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// The list of aggregation types (comma separated) to retrieve. @@ -118,6 +120,13 @@ internal MetricsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } + if (resourceUri != null) + { + if (resourceUri.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); + } + } string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -142,7 +151,7 @@ internal MetricsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metrics").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/metrics").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); List _queryParameters = new List(); if (odataQuery != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperationsExtensions.cs index d6fa05e274066..3be2a5704802b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricsOperationsExtensions.cs @@ -42,7 +42,9 @@ public static partial class MetricsOperationsExtensions /// The interval (i.e. timegrain) of the query. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special case: If a + /// metricname itself has a comma in it then use %2 to indicate it. Eg: + /// 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// The list of aggregation types (comma separated) to retrieve. @@ -90,7 +92,9 @@ public static partial class MetricsOperationsExtensions /// The interval (i.e. timegrain) of the query. /// /// - /// The names of the metrics (comma separated) to retrieve. + /// The names of the metrics (comma separated) to retrieve. Special case: If a + /// metricname itself has a comma in it then use %2 to indicate it. Eg: + /// 'Metric,Name1' should be **'Metric%2Name1'** /// /// /// The list of aggregation types (comma separated) to retrieve. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs index 20e0287652bca..66939ccef2cdd 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Monitor.Models /// An action group resource. /// [Rest.Serialization.JsonTransformation] - public partial class ActionGroupResource : Resource + public partial class ActionGroupResource : AzureResource { /// /// Initializes a new instance of the ActionGroupResource class. @@ -43,6 +43,8 @@ public ActionGroupResource() /// Azure resource Id /// Azure resource name /// Azure resource type + /// Azure resource kind + /// Azure resource identity /// Resource tags /// The list of email receivers that are /// part of this action group. @@ -66,8 +68,8 @@ public ActionGroupResource() /// The list of ARM role receivers that /// are part of this action group. Roles are Azure RBAC roles and only /// built-in roles are supported. - public ActionGroupResource(string location, string groupShortName, bool enabled, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList emailReceivers = default(IList), IList smsReceivers = default(IList), IList webhookReceivers = default(IList), IList itsmReceivers = default(IList), IList azureAppPushReceivers = default(IList), IList automationRunbookReceivers = default(IList), IList voiceReceivers = default(IList), IList logicAppReceivers = default(IList), IList azureFunctionReceivers = default(IList), IList armRoleReceivers = default(IList)) - : base(location, id, name, type, tags) + public ActionGroupResource(string location, string groupShortName, bool enabled, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), string identity = default(string), IDictionary tags = default(IDictionary), IList emailReceivers = default(IList), IList smsReceivers = default(IList), IList webhookReceivers = default(IList), IList itsmReceivers = default(IList), IList azureAppPushReceivers = default(IList), IList automationRunbookReceivers = default(IList), IList voiceReceivers = default(IList), IList logicAppReceivers = default(IList), IList azureFunctionReceivers = default(IList), IList armRoleReceivers = default(IList)) + : base(location, id, name, type, kind, identity, tags) { GroupShortName = groupShortName; Enabled = enabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs index 8ca7e0796dbd1..3d3ee52880017 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs @@ -47,13 +47,24 @@ public ActivityLogAlertResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// Indicates whether this activity log alert is /// enabled. If an activity log alert is not enabled, then none of its /// actions will be activated. /// A description of this activity log /// alert. - public ActivityLogAlertResource(string location, IList scopes, ActivityLogAlertAllOfCondition condition, ActivityLogAlertActionList actions, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), bool? enabled = default(bool?), string description = default(string)) - : base(location, id, name, type, tags) + public ActivityLogAlertResource(string location, IList scopes, ActivityLogAlertAllOfCondition condition, ActivityLogAlertActionList actions, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), bool? enabled = default(bool?), string description = default(string)) + : base(location, id, name, type, tags, kind, etag) { Scopes = scopes; Enabled = enabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs new file mode 100644 index 0000000000000..e2007d5c8ddcd --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for AggregationTypeEnum. + /// + public static class AggregationTypeEnum + { + public const string Average = "Average"; + public const string Count = "Count"; + public const string Minimum = "Minimum"; + public const string Maximum = "Maximum"; + public const string Total = "Total"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs index 3720c83e68d92..7c977c3b9741d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs @@ -45,20 +45,36 @@ public AlertRuleResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// the description of the alert rule that /// will be included in the alert email. + /// the provisioning state. + /// action that is performed when the alert rule + /// becomes active, and when an alert condition is resolved. /// the array of actions that are performed when /// the alert rule becomes active, and when an alert condition is /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public AlertRuleResource(string location, string alertRuleResourceName, bool isEnabled, RuleCondition condition, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) - : base(location, id, name, type, tags) + public AlertRuleResource(string location, string alertRuleResourceName, bool isEnabled, RuleCondition condition, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string description = default(string), string provisioningState = default(string), RuleAction action = default(RuleAction), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + : base(location, id, name, type, tags, kind, etag) { AlertRuleResourceName = alertRuleResourceName; Description = description; + ProvisioningState = provisioningState; IsEnabled = isEnabled; Condition = condition; + Action = action; Actions = actions; LastUpdatedTime = lastUpdatedTime; CustomInit(); @@ -82,6 +98,12 @@ public AlertRuleResource() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + /// + /// Gets or sets the provisioning state. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + /// /// Gets or sets the flag that indicates whether the alert rule is /// enabled. @@ -96,6 +118,13 @@ public AlertRuleResource() [JsonProperty(PropertyName = "properties.condition")] public RuleCondition Condition { get; set; } + /// + /// Gets or sets action that is performed when the alert rule becomes + /// active, and when an alert condition is resolved. + /// + [JsonProperty(PropertyName = "properties.action")] + public RuleAction Action { get; set; } + /// /// Gets or sets the array of actions that are performed when the alert /// rule becomes active, and when an alert condition is resolved. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs index b80302c7690e2..002d92250887c 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs @@ -42,18 +42,23 @@ public AlertRuleResourcePatch() /// Resource tags /// the description of the alert rule that /// will be included in the alert email. + /// the provisioning state. + /// action that is performed when the alert rule + /// becomes active, and when an alert condition is resolved. /// the array of actions that are performed when /// the alert rule becomes active, and when an alert condition is /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public AlertRuleResourcePatch(string name, bool isEnabled, RuleCondition condition, IDictionary tags = default(IDictionary), string description = default(string), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + public AlertRuleResourcePatch(string name, bool isEnabled, RuleCondition condition, IDictionary tags = default(IDictionary), string description = default(string), string provisioningState = default(string), RuleAction action = default(RuleAction), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) { Tags = tags; Name = name; Description = description; + ProvisioningState = provisioningState; IsEnabled = isEnabled; Condition = condition; + Action = action; Actions = actions; LastUpdatedTime = lastUpdatedTime; CustomInit(); @@ -83,6 +88,12 @@ public AlertRuleResourcePatch() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + /// + /// Gets or sets the provisioning state. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + /// /// Gets or sets the flag that indicates whether the alert rule is /// enabled. @@ -97,6 +108,13 @@ public AlertRuleResourcePatch() [JsonProperty(PropertyName = "properties.condition")] public RuleCondition Condition { get; set; } + /// + /// Gets or sets action that is performed when the alert rule becomes + /// active, and when an alert condition is resolved. + /// + [JsonProperty(PropertyName = "properties.action")] + public RuleAction Action { get; set; } + /// /// Gets or sets the array of actions that are performed when the alert /// rule becomes active, and when an alert condition is resolved. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs index b6868eab88908..47589c3f584dd 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs @@ -35,7 +35,7 @@ public ArmRoleReceiver() /// The arm role id. /// Indicates whether to use common /// alert schema. - public ArmRoleReceiver(string name, string roleId, bool useCommonAlertSchema) + public ArmRoleReceiver(string name, string roleId, bool? useCommonAlertSchema = default(bool?)) { Name = name; RoleId = roleId; @@ -65,7 +65,7 @@ public ArmRoleReceiver(string name, string roleId, bool useCommonAlertSchema) /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs index 3acb0207fb462..3d140ce5dc95c 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs @@ -38,12 +38,12 @@ public AutomationRunbookReceiver() /// to this runbook. /// Indicates whether this instance is /// global runbook. - /// Indicates whether to use common - /// alert schema. /// Indicates name of the webhook. /// The URI where webhooks should be /// sent. - public AutomationRunbookReceiver(string automationAccountId, string runbookName, string webhookResourceId, bool isGlobalRunbook, bool useCommonAlertSchema, string name = default(string), string serviceUri = default(string)) + /// Indicates whether to use common + /// alert schema. + public AutomationRunbookReceiver(string automationAccountId, string runbookName, string webhookResourceId, bool isGlobalRunbook, string name = default(string), string serviceUri = default(string), bool? useCommonAlertSchema = default(bool?)) { AutomationAccountId = automationAccountId; RunbookName = runbookName; @@ -101,7 +101,7 @@ public AutomationRunbookReceiver() /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs index 7ce1047ae27f6..16292838afb65 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs @@ -42,6 +42,17 @@ public AutoscaleSettingResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// the collection of /// notifications. /// the enabled flag. Specifies whether automatic @@ -51,14 +62,17 @@ public AutoscaleSettingResource() /// autoscale setting. /// the resource identifier of the /// resource that the autoscale setting should be added to. - public AutoscaleSettingResource(string location, IList profiles, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList notifications = default(IList), bool? enabled = default(bool?), string autoscaleSettingResourceName = default(string), string targetResourceUri = default(string)) - : base(location, id, name, type, tags) + /// the location of the resource + /// that the autoscale setting should be added to. + public AutoscaleSettingResource(string location, IList profiles, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), IList notifications = default(IList), bool? enabled = default(bool?), string autoscaleSettingResourceName = default(string), string targetResourceUri = default(string), string targetResourceLocation = default(string)) + : base(location, id, name, type, tags, kind, etag) { Profiles = profiles; Notifications = notifications; Enabled = enabled; AutoscaleSettingResourceName = autoscaleSettingResourceName; TargetResourceUri = targetResourceUri; + TargetResourceLocation = targetResourceLocation; CustomInit(); } @@ -101,6 +115,13 @@ public AutoscaleSettingResource() [JsonProperty(PropertyName = "properties.targetResourceUri")] public string TargetResourceUri { get; set; } + /// + /// Gets or sets the location of the resource that the autoscale + /// setting should be added to. + /// + [JsonProperty(PropertyName = "properties.targetResourceLocation")] + public string TargetResourceLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResourcePatch.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResourcePatch.cs index fc9d799fc6cc9..c23a95232d7f8 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResourcePatch.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResourcePatch.cs @@ -48,7 +48,9 @@ public AutoscaleSettingResourcePatch() /// the name of the autoscale setting. /// the resource identifier of the /// resource that the autoscale setting should be added to. - public AutoscaleSettingResourcePatch(IList profiles, IDictionary tags = default(IDictionary), IList notifications = default(IList), bool? enabled = default(bool?), string name = default(string), string targetResourceUri = default(string)) + /// the location of the resource + /// that the autoscale setting should be added to. + public AutoscaleSettingResourcePatch(IList profiles, IDictionary tags = default(IDictionary), IList notifications = default(IList), bool? enabled = default(bool?), string name = default(string), string targetResourceUri = default(string), string targetResourceLocation = default(string)) { Tags = tags; Profiles = profiles; @@ -56,6 +58,7 @@ public AutoscaleSettingResourcePatch() Enabled = enabled; Name = name; TargetResourceUri = targetResourceUri; + TargetResourceLocation = targetResourceLocation; CustomInit(); } @@ -104,6 +107,13 @@ public AutoscaleSettingResourcePatch() [JsonProperty(PropertyName = "properties.targetResourceUri")] public string TargetResourceUri { get; set; } + /// + /// Gets or sets the location of the resource that the autoscale + /// setting should be added to. + /// + [JsonProperty(PropertyName = "properties.targetResourceLocation")] + public string TargetResourceLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs index 9a0157305b0be..fcf2fd801cbd6 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs @@ -40,7 +40,7 @@ public AzureFunctionReceiver() /// request sent to. /// Indicates whether to use common /// alert schema. - public AzureFunctionReceiver(string name, string functionAppResourceId, string functionName, string httpTriggerUrl, bool useCommonAlertSchema) + public AzureFunctionReceiver(string name, string functionAppResourceId, string functionName, string httpTriggerUrl, bool? useCommonAlertSchema = default(bool?)) { Name = name; FunctionAppResourceId = functionAppResourceId; @@ -84,7 +84,7 @@ public AzureFunctionReceiver(string name, string functionAppResourceId, string f /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs index 024b31b45b870..446b59044a29b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs @@ -1,4 +1,8 @@ // +// 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. @@ -6,7 +10,6 @@ namespace Microsoft.Azure.Management.Monitor.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -31,7 +34,7 @@ public AzureMonitorMetricsDestination() /// A friendly name for the destination. /// This name should be unique across all destinations (regardless of /// type) within the data collection rule. - public AzureMonitorMetricsDestination(string name) + public AzureMonitorMetricsDestination(string name = default(string)) { Name = name; CustomInit(); @@ -50,18 +53,5 @@ public AzureMonitorMetricsDestination(string name) [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureResource.cs new file mode 100644 index 0000000000000..1b1afcdc72f90 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureResource.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An azure resource object + /// + public partial class AzureResource : IResource + { + /// + /// Initializes a new instance of the AzureResource class. + /// + public AzureResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureResource class. + /// + /// Resource location + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Azure resource kind + /// Azure resource identity + /// Resource tags + public AzureResource(string location, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), string identity = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Kind = kind; + Identity = identity; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets azure resource kind + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Gets azure resource identity + /// + [JsonProperty(PropertyName = "identity")] + public string Identity { get; private set; } + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs deleted file mode 100644 index 2aefd3ac9a2c3..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs +++ /dev/null @@ -1,91 +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.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The baseline values for a single sensitivity value. - /// - public partial class Baseline - { - /// - /// Initializes a new instance of the Baseline class. - /// - public Baseline() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Baseline class. - /// - /// the sensitivity of the baseline. Possible - /// values include: 'Low', 'Medium', 'High' - /// The low thresholds of the - /// baseline. - /// The high thresholds of the - /// baseline. - public Baseline(Sensitivity sensitivity, IList lowThresholds, IList highThresholds) - { - Sensitivity = sensitivity; - LowThresholds = lowThresholds; - HighThresholds = highThresholds; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the sensitivity of the baseline. Possible values - /// include: 'Low', 'Medium', 'High' - /// - [JsonProperty(PropertyName = "sensitivity")] - public Sensitivity Sensitivity { get; set; } - - /// - /// Gets or sets the low thresholds of the baseline. - /// - [JsonProperty(PropertyName = "lowThresholds")] - public IList LowThresholds { get; set; } - - /// - /// Gets or sets the high thresholds of the baseline. - /// - [JsonProperty(PropertyName = "highThresholds")] - public IList HighThresholds { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (LowThresholds == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LowThresholds"); - } - if (HighThresholds == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "HighThresholds"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineMetadataValue.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineMetadataValue.cs deleted file mode 100644 index 637a70d9b84bb..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineMetadataValue.cs +++ /dev/null @@ -1,72 +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.Monitor.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Represents a baseline metadata value. - /// - public partial class BaselineMetadataValue - { - /// - /// Initializes a new instance of the BaselineMetadataValue class. - /// - public BaselineMetadataValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaselineMetadataValue class. - /// - /// the name of the metadata. - /// the value of the metadata. - public BaselineMetadataValue(LocalizableString name = default(LocalizableString), string value = default(string)) - { - Name = name; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the metadata. - /// - [JsonProperty(PropertyName = "name")] - public LocalizableString Name { get; set; } - - /// - /// Gets or sets the value of the metadata. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name != null) - { - Name.Validate(); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineResponse.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineResponse.cs deleted file mode 100644 index cb3a7c95483f9..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineResponse.cs +++ /dev/null @@ -1,171 +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.Monitor.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response to a baseline query. - /// - [Rest.Serialization.JsonTransformation] - public partial class BaselineResponse - { - /// - /// Initializes a new instance of the BaselineResponse class. - /// - public BaselineResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaselineResponse class. - /// - /// the metric baseline Id. - /// the resource type of the baseline - /// resource. - /// the name and the display name of the metric, - /// i.e. it is localizable string. - /// The timespan for which the data was - /// retrieved. Its value consists of two datetimes concatenated, - /// separated by '/'. This may be adjusted in the future and returned - /// back from what was originally requested. - /// The interval (window size) for which the - /// metric data was returned in. This may be adjusted in the future - /// and returned back from what was originally requested. This is not - /// present if a metadata request was made. - /// The aggregation type of the - /// metric. - /// the array of timestamps of the - /// baselines. - /// the baseline values for each - /// sensitivity. - /// the baseline metadata values. - public BaselineResponse(string id = default(string), string type = default(string), LocalizableString name = default(LocalizableString), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), IList timestamps = default(IList), IList baseline = default(IList), IList metadata = default(IList)) - { - Id = id; - Type = type; - Name = name; - Timespan = timespan; - Interval = interval; - Aggregation = aggregation; - Timestamps = timestamps; - Baseline = baseline; - Metadata = metadata; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the metric baseline Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the resource type of the baseline resource. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets the name and the display name of the metric, i.e. it is - /// localizable string. - /// - [JsonProperty(PropertyName = "name")] - public LocalizableString Name { get; private set; } - - /// - /// Gets or sets the timespan for which the data was retrieved. Its - /// value consists of two datetimes concatenated, separated by '/'. - /// This may be adjusted in the future and returned back from what was - /// originally requested. - /// - [JsonProperty(PropertyName = "properties.timespan")] - public string Timespan { get; set; } - - /// - /// Gets or sets the interval (window size) for which the metric data - /// was returned in. This may be adjusted in the future and returned - /// back from what was originally requested. This is not present if a - /// metadata request was made. - /// - [JsonProperty(PropertyName = "properties.interval")] - public System.TimeSpan? Interval { get; set; } - - /// - /// Gets or sets the aggregation type of the metric. - /// - [JsonProperty(PropertyName = "properties.aggregation")] - public string Aggregation { get; set; } - - /// - /// Gets or sets the array of timestamps of the baselines. - /// - [JsonProperty(PropertyName = "properties.timestamps")] - public IList Timestamps { get; set; } - - /// - /// Gets or sets the baseline values for each sensitivity. - /// - [JsonProperty(PropertyName = "properties.baseline")] - public IList Baseline { get; set; } - - /// - /// Gets or sets the baseline metadata values. - /// - [JsonProperty(PropertyName = "properties.metadata")] - public IList Metadata { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name != null) - { - Name.Validate(); - } - if (Baseline != null) - { - foreach (var element in Baseline) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Metadata != null) - { - foreach (var element1 in Metadata) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CalculateBaselineResponse.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CalculateBaselineResponse.cs deleted file mode 100644 index f635318ab02e1..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CalculateBaselineResponse.cs +++ /dev/null @@ -1,100 +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.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response to a calculate baseline call. - /// - public partial class CalculateBaselineResponse - { - /// - /// Initializes a new instance of the CalculateBaselineResponse class. - /// - public CalculateBaselineResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CalculateBaselineResponse class. - /// - /// the resource type of the baseline - /// resource. - /// the baseline values for each - /// sensitivity. - /// the array of timestamps of the - /// baselines. - public CalculateBaselineResponse(string type, IList baseline, IList timestamps = default(IList)) - { - Type = type; - Timestamps = timestamps; - Baseline = baseline; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource type of the baseline resource. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the array of timestamps of the baselines. - /// - [JsonProperty(PropertyName = "timestamps")] - public IList Timestamps { get; set; } - - /// - /// Gets or sets the baseline values for each sensitivity. - /// - [JsonProperty(PropertyName = "baseline")] - public IList Baseline { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); - } - if (Baseline == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Baseline"); - } - if (Baseline != null) - { - foreach (var element in Baseline) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs index 98d5f8fd2d69a..1be56cc4dae50 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs @@ -16,6 +16,8 @@ namespace Microsoft.Azure.Management.Monitor.Models /// public static class ConditionalOperator { + public const string GreaterThanOrEqual = "GreaterThanOrEqual"; + public const string LessThanOrEqual = "LessThanOrEqual"; public const string GreaterThan = "GreaterThan"; public const string LessThan = "LessThan"; public const string Equal = "Equal"; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConfigurationAccessEndpointSpec.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConfigurationAccessEndpointSpec.cs new file mode 100644 index 0000000000000..2c7d75a9f0b41 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConfigurationAccessEndpointSpec.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the endpoint used for accessing configuration. + /// + public partial class ConfigurationAccessEndpointSpec + { + /// + /// Initializes a new instance of the ConfigurationAccessEndpointSpec + /// class. + /// + public ConfigurationAccessEndpointSpec() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigurationAccessEndpointSpec + /// class. + /// + /// The endpoint. This property is + /// READ-ONLY. + public ConfigurationAccessEndpointSpec(string endpoint = default(string)) + { + Endpoint = endpoint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the endpoint. This property is READ-ONLY. + /// + [JsonProperty(PropertyName = "endpoint")] + public string Endpoint { get; private set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CreatedByType.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CreatedByType.cs new file mode 100644 index 0000000000000..2d83721489cb2 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpoint.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpoint.cs new file mode 100644 index 0000000000000..28b5effb0b647 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpoint.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of data collection endpoint. + /// + public partial class DataCollectionEndpoint + { + /// + /// Initializes a new instance of the DataCollectionEndpoint class. + /// + public DataCollectionEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataCollectionEndpoint class. + /// + /// Description of the data collection + /// endpoint. + /// The immutable ID of this data collection + /// endpoint resource. This property is READ-ONLY. + /// The endpoint used by agents to + /// access their configuration. + /// The endpoint used by clients to ingest + /// logs. + /// Network access control rules for the + /// endpoints. + /// The resource provisioning state. + /// This property is READ-ONLY. Possible values include: 'Creating', + /// 'Updating', 'Deleting', 'Succeeded', 'Failed' + public DataCollectionEndpoint(string description = default(string), string immutableId = default(string), DataCollectionEndpointConfigurationAccess configurationAccess = default(DataCollectionEndpointConfigurationAccess), DataCollectionEndpointLogsIngestion logsIngestion = default(DataCollectionEndpointLogsIngestion), DataCollectionEndpointNetworkAcls networkAcls = default(DataCollectionEndpointNetworkAcls), string provisioningState = default(string)) + { + Description = description; + ImmutableId = immutableId; + ConfigurationAccess = configurationAccess; + LogsIngestion = logsIngestion; + NetworkAcls = networkAcls; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the data collection endpoint. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the immutable ID of this data collection endpoint + /// resource. This property is READ-ONLY. + /// + [JsonProperty(PropertyName = "immutableId")] + public string ImmutableId { get; set; } + + /// + /// Gets or sets the endpoint used by agents to access their + /// configuration. + /// + [JsonProperty(PropertyName = "configurationAccess")] + public DataCollectionEndpointConfigurationAccess ConfigurationAccess { get; set; } + + /// + /// Gets or sets the endpoint used by clients to ingest logs. + /// + [JsonProperty(PropertyName = "logsIngestion")] + public DataCollectionEndpointLogsIngestion LogsIngestion { get; set; } + + /// + /// Gets or sets network access control rules for the endpoints. + /// + [JsonProperty(PropertyName = "networkAcls")] + public DataCollectionEndpointNetworkAcls NetworkAcls { get; set; } + + /// + /// Gets the resource provisioning state. This property is READ-ONLY. + /// Possible values include: 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointConfigurationAccess.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointConfigurationAccess.cs new file mode 100644 index 0000000000000..66fc69250de02 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointConfigurationAccess.cs @@ -0,0 +1,47 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The endpoint used by agents to access their configuration. + /// + public partial class DataCollectionEndpointConfigurationAccess : ConfigurationAccessEndpointSpec + { + /// + /// Initializes a new instance of the + /// DataCollectionEndpointConfigurationAccess class. + /// + public DataCollectionEndpointConfigurationAccess() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataCollectionEndpointConfigurationAccess class. + /// + /// The endpoint. This property is + /// READ-ONLY. + public DataCollectionEndpointConfigurationAccess(string endpoint = default(string)) + : base(endpoint) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointLogsIngestion.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointLogsIngestion.cs new file mode 100644 index 0000000000000..64d02f18a7dbf --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointLogsIngestion.cs @@ -0,0 +1,47 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The endpoint used by clients to ingest logs. + /// + public partial class DataCollectionEndpointLogsIngestion : LogsIngestionEndpointSpec + { + /// + /// Initializes a new instance of the + /// DataCollectionEndpointLogsIngestion class. + /// + public DataCollectionEndpointLogsIngestion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataCollectionEndpointLogsIngestion class. + /// + /// The endpoint. This property is + /// READ-ONLY. + public DataCollectionEndpointLogsIngestion(string endpoint = default(string)) + : base(endpoint) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointNetworkAcls.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointNetworkAcls.cs new file mode 100644 index 0000000000000..e1f9e8c7d2758 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointNetworkAcls.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Network access control rules for the endpoints. + /// + public partial class DataCollectionEndpointNetworkAcls : NetworkRuleSet + { + /// + /// Initializes a new instance of the DataCollectionEndpointNetworkAcls + /// class. + /// + public DataCollectionEndpointNetworkAcls() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataCollectionEndpointNetworkAcls + /// class. + /// + /// The configuration to set whether + /// network access from public internet to the endpoints are allowed. + /// Possible values include: 'Enabled', 'Disabled' + public DataCollectionEndpointNetworkAcls(string publicNetworkAccess = default(string)) + : base(publicNetworkAccess) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointResource.cs new file mode 100644 index 0000000000000..9234e89e65929 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointResource.cs @@ -0,0 +1,192 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Definition of ARM tracked top level resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class DataCollectionEndpointResource : IResource + { + /// + /// Initializes a new instance of the DataCollectionEndpointResource + /// class. + /// + public DataCollectionEndpointResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataCollectionEndpointResource + /// class. + /// + /// The geo-location where the resource + /// lives. + /// Description of the data collection + /// endpoint. + /// The immutable ID of this data collection + /// endpoint resource. This property is READ-ONLY. + /// The endpoint used by agents to + /// access their configuration. + /// The endpoint used by clients to ingest + /// logs. + /// Network access control rules for the + /// endpoints. + /// The resource provisioning state. + /// This property is READ-ONLY. Possible values include: 'Creating', + /// 'Updating', 'Deleting', 'Succeeded', 'Failed' + /// Resource tags. + /// The kind of the resource. Possible values + /// include: 'Linux', 'Windows' + /// Fully qualified ID of the resource. + /// The name of the resource. + /// The type of the resource. + /// Resource entity tag (ETag). + /// Metadata pertaining to creation and last + /// modification of the resource. + public DataCollectionEndpointResource(string location, string description = default(string), string immutableId = default(string), DataCollectionEndpointConfigurationAccess configurationAccess = default(DataCollectionEndpointConfigurationAccess), DataCollectionEndpointLogsIngestion logsIngestion = default(DataCollectionEndpointLogsIngestion), DataCollectionEndpointNetworkAcls networkAcls = default(DataCollectionEndpointNetworkAcls), string provisioningState = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string id = default(string), string name = default(string), string type = default(string), string etag = default(string), DataCollectionEndpointResourceSystemData systemData = default(DataCollectionEndpointResourceSystemData)) + { + Description = description; + ImmutableId = immutableId; + ConfigurationAccess = configurationAccess; + LogsIngestion = logsIngestion; + NetworkAcls = networkAcls; + ProvisioningState = provisioningState; + Location = location; + Tags = tags; + Kind = kind; + Id = id; + Name = name; + Type = type; + Etag = etag; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the data collection endpoint. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the immutable ID of this data collection endpoint + /// resource. This property is READ-ONLY. + /// + [JsonProperty(PropertyName = "properties.immutableId")] + public string ImmutableId { get; set; } + + /// + /// Gets or sets the endpoint used by agents to access their + /// configuration. + /// + [JsonProperty(PropertyName = "properties.configurationAccess")] + public DataCollectionEndpointConfigurationAccess ConfigurationAccess { get; set; } + + /// + /// Gets or sets the endpoint used by clients to ingest logs. + /// + [JsonProperty(PropertyName = "properties.logsIngestion")] + public DataCollectionEndpointLogsIngestion LogsIngestion { get; set; } + + /// + /// Gets or sets network access control rules for the endpoints. + /// + [JsonProperty(PropertyName = "properties.networkAcls")] + public DataCollectionEndpointNetworkAcls NetworkAcls { get; set; } + + /// + /// Gets the resource provisioning state. This property is READ-ONLY. + /// Possible values include: 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the geo-location where the resource lives. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the kind of the resource. Possible values include: + /// 'Linux', 'Windows' + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets fully qualified ID of the resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets resource entity tag (ETag). + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// Gets metadata pertaining to creation and last modification of the + /// resource. + /// + [JsonProperty(PropertyName = "systemData")] + public DataCollectionEndpointResourceSystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointResourceSystemData.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointResourceSystemData.cs new file mode 100644 index 0000000000000..3523e62e87b89 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionEndpointResourceSystemData.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.Monitor.Models +{ + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class DataCollectionEndpointResourceSystemData : SystemData + { + /// + /// Initializes a new instance of the + /// DataCollectionEndpointResourceSystemData class. + /// + public DataCollectionEndpointResourceSystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataCollectionEndpointResourceSystemData 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 DataCollectionEndpointResourceSystemData(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?)) + : base(createdBy, createdByType, createdAt, lastModifiedBy, lastModifiedByType, lastModifiedAt) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRule.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRule.cs new file mode 100644 index 0000000000000..d258af5daba44 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRule.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.Monitor.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Definition of what monitoring data to collect and where that data + /// should be sent. + /// + public partial class DataCollectionRule + { + /// + /// Initializes a new instance of the DataCollectionRule class. + /// + public DataCollectionRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataCollectionRule class. + /// + /// Description of the data collection + /// rule. + /// The immutable ID of this data collection + /// rule. This property is READ-ONLY. + /// The specification of data sources. + /// This property is optional and can be omitted if the rule is meant + /// to be used via direct calls to the provisioned endpoint. + /// The specification of + /// destinations. + /// The specification of data flows. + /// The resource provisioning state. + /// Possible values include: 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed' + public DataCollectionRule(string description = default(string), string immutableId = default(string), DataCollectionRuleDataSources dataSources = default(DataCollectionRuleDataSources), DataCollectionRuleDestinations destinations = default(DataCollectionRuleDestinations), IList dataFlows = default(IList), string provisioningState = default(string)) + { + Description = description; + ImmutableId = immutableId; + DataSources = dataSources; + Destinations = destinations; + DataFlows = dataFlows; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the data collection rule. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets the immutable ID of this data collection rule. This property + /// is READ-ONLY. + /// + [JsonProperty(PropertyName = "immutableId")] + public string ImmutableId { get; private set; } + + /// + /// Gets or sets the specification of data sources. + /// This property is optional and can be omitted if the rule is meant + /// to be used via direct calls to the provisioned endpoint. + /// + [JsonProperty(PropertyName = "dataSources")] + public DataCollectionRuleDataSources DataSources { get; set; } + + /// + /// Gets or sets the specification of destinations. + /// + [JsonProperty(PropertyName = "destinations")] + public DataCollectionRuleDestinations Destinations { get; set; } + + /// + /// Gets or sets the specification of data flows. + /// + [JsonProperty(PropertyName = "dataFlows")] + public IList DataFlows { get; set; } + + /// + /// Gets the resource provisioning state. Possible values include: + /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociation.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociation.cs new file mode 100644 index 0000000000000..5db27cf1e0791 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociation.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of association of a data collection rule with a monitored + /// Azure resource. + /// + public partial class DataCollectionRuleAssociation + { + /// + /// Initializes a new instance of the DataCollectionRuleAssociation + /// class. + /// + public DataCollectionRuleAssociation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataCollectionRuleAssociation + /// class. + /// + /// Description of the association. + /// The resource ID of the data + /// collection rule that is to be associated. + /// The resource ID of the data + /// collection endpoint that is to be associated. + /// The resource provisioning state. + /// Possible values include: 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed' + public DataCollectionRuleAssociation(string description = default(string), string dataCollectionRuleId = default(string), string dataCollectionEndpointId = default(string), string provisioningState = default(string)) + { + Description = description; + DataCollectionRuleId = dataCollectionRuleId; + DataCollectionEndpointId = dataCollectionEndpointId; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the association. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the resource ID of the data collection rule that is to + /// be associated. + /// + [JsonProperty(PropertyName = "dataCollectionRuleId")] + public string DataCollectionRuleId { get; set; } + + /// + /// Gets or sets the resource ID of the data collection endpoint that + /// is to be associated. + /// + [JsonProperty(PropertyName = "dataCollectionEndpointId")] + public string DataCollectionEndpointId { get; set; } + + /// + /// Gets the resource provisioning state. Possible values include: + /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs index 96789654534da..bafc6eee17e00 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs @@ -1,4 +1,8 @@ // +// 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. @@ -7,13 +11,16 @@ namespace Microsoft.Azure.Management.Monitor.Models { using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Linq; /// /// Definition of generic ARM proxy resource. /// [Rest.Serialization.JsonTransformation] - public partial class DataCollectionRuleAssociationProxyOnlyResource : ProxyOnlyResource + public partial class DataCollectionRuleAssociationProxyOnlyResource : IResource { /// /// Initializes a new instance of the @@ -28,9 +35,11 @@ public DataCollectionRuleAssociationProxyOnlyResource() /// Initializes a new instance of the /// DataCollectionRuleAssociationProxyOnlyResource class. /// + /// Description of the association. /// The resource ID of the data /// collection rule that is to be associated. - /// Description of the association. + /// The resource ID of the data + /// collection endpoint that is to be associated. /// The resource provisioning state. /// Possible values include: 'Creating', 'Updating', 'Deleting', /// 'Succeeded', 'Failed' @@ -38,13 +47,19 @@ public DataCollectionRuleAssociationProxyOnlyResource() /// The name of the resource. /// The type of the resource. /// Resource entity tag (ETag). - public DataCollectionRuleAssociationProxyOnlyResource(string dataCollectionRuleId, string description = default(string), string provisioningState = default(string), string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id, name, type) + /// Metadata pertaining to creation and last + /// modification of the resource. + public DataCollectionRuleAssociationProxyOnlyResource(string description = default(string), string dataCollectionRuleId = default(string), string dataCollectionEndpointId = default(string), string provisioningState = default(string), string id = default(string), string name = default(string), string type = default(string), string etag = default(string), DataCollectionRuleAssociationProxyOnlyResourceSystemData systemData = default(DataCollectionRuleAssociationProxyOnlyResourceSystemData)) { Description = description; DataCollectionRuleId = dataCollectionRuleId; + DataCollectionEndpointId = dataCollectionEndpointId; ProvisioningState = provisioningState; + Id = id; + Name = name; + Type = type; Etag = etag; + SystemData = systemData; CustomInit(); } @@ -66,6 +81,13 @@ public DataCollectionRuleAssociationProxyOnlyResource() [JsonProperty(PropertyName = "properties.dataCollectionRuleId")] public string DataCollectionRuleId { get; set; } + /// + /// Gets or sets the resource ID of the data collection endpoint that + /// is to be associated. + /// + [JsonProperty(PropertyName = "properties.dataCollectionEndpointId")] + public string DataCollectionEndpointId { get; set; } + /// /// Gets the resource provisioning state. Possible values include: /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed' @@ -73,6 +95,24 @@ public DataCollectionRuleAssociationProxyOnlyResource() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets fully qualified ID of the resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + /// /// Gets resource entity tag (ETag). /// @@ -80,17 +120,11 @@ public DataCollectionRuleAssociationProxyOnlyResource() public string Etag { get; private set; } /// - /// Validate the object. + /// Gets metadata pertaining to creation and last modification of the + /// resource. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DataCollectionRuleId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataCollectionRuleId"); - } - } + [JsonProperty(PropertyName = "systemData")] + public DataCollectionRuleAssociationProxyOnlyResourceSystemData SystemData { get; private set; } + } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResourceSystemData.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResourceSystemData.cs new file mode 100644 index 0000000000000..c3b1e596427e3 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResourceSystemData.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.Monitor.Models +{ + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class DataCollectionRuleAssociationProxyOnlyResourceSystemData : SystemData + { + /// + /// Initializes a new instance of the + /// DataCollectionRuleAssociationProxyOnlyResourceSystemData class. + /// + public DataCollectionRuleAssociationProxyOnlyResourceSystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataCollectionRuleAssociationProxyOnlyResourceSystemData 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 DataCollectionRuleAssociationProxyOnlyResourceSystemData(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?)) + : base(createdBy, createdByType, createdAt, lastModifiedBy, lastModifiedByType, lastModifiedAt) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs index a8f31f4b717d3..0378dfc566cb0 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs index 99cb30cf99024..845c0379af745 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs index 4d31b6a37da8b..d09428f9cb643 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs @@ -1,4 +1,8 @@ // +// 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. @@ -7,14 +11,18 @@ namespace Microsoft.Azure.Management.Monitor.Models { using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; using System.Collections.Generic; + using System.Linq; /// /// Definition of ARM tracked top level resource. /// [Rest.Serialization.JsonTransformation] - public partial class DataCollectionRuleResource : Resource + public partial class DataCollectionRuleResource : IResource { /// /// Initializes a new instance of the DataCollectionRuleResource class. @@ -27,34 +35,46 @@ public DataCollectionRuleResource() /// /// Initializes a new instance of the DataCollectionRuleResource class. /// - /// The specification of - /// destinations. - /// The specification of data flows. /// The geo-location where the resource /// lives. /// Description of the data collection /// rule. + /// The immutable ID of this data collection + /// rule. This property is READ-ONLY. /// The specification of data sources. /// This property is optional and can be omitted if the rule is meant /// to be used via direct calls to the provisioned endpoint. + /// The specification of + /// destinations. + /// The specification of data flows. /// The resource provisioning state. /// Possible values include: 'Creating', 'Updating', 'Deleting', /// 'Succeeded', 'Failed' /// Resource tags. + /// The kind of the resource. Possible values + /// include: 'Linux', 'Windows' /// Fully qualified ID of the resource. /// The name of the resource. /// The type of the resource. /// Resource entity tag (ETag). - public DataCollectionRuleResource(DataCollectionRuleDestinations destinations, IList dataFlows, string location, string description = default(string), DataCollectionRuleDataSources dataSources = default(DataCollectionRuleDataSources), string provisioningState = default(string), IDictionary tags = default(IDictionary), string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(location, id, name, type, tags) + /// Metadata pertaining to creation and last + /// modification of the resource. + public DataCollectionRuleResource(string location, string description = default(string), string immutableId = default(string), DataCollectionRuleDataSources dataSources = default(DataCollectionRuleDataSources), DataCollectionRuleDestinations destinations = default(DataCollectionRuleDestinations), IList dataFlows = default(IList), string provisioningState = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string id = default(string), string name = default(string), string type = default(string), string etag = default(string), DataCollectionRuleResourceSystemData systemData = default(DataCollectionRuleResourceSystemData)) { Description = description; + ImmutableId = immutableId; DataSources = dataSources; Destinations = destinations; DataFlows = dataFlows; ProvisioningState = provisioningState; Location = location; + Tags = tags; + Kind = kind; + Id = id; + Name = name; + Type = type; Etag = etag; + SystemData = systemData; CustomInit(); } @@ -69,6 +89,13 @@ public DataCollectionRuleResource() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + /// + /// Gets the immutable ID of this data collection rule. This property + /// is READ-ONLY. + /// + [JsonProperty(PropertyName = "properties.immutableId")] + public string ImmutableId { get; private set; } + /// /// Gets or sets the specification of data sources. /// This property is optional and can be omitted if the rule is meant @@ -96,44 +123,68 @@ public DataCollectionRuleResource() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets the geo-location where the resource lives. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the kind of the resource. Possible values include: + /// 'Linux', 'Windows' + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets fully qualified ID of the resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + /// /// Gets resource entity tag (ETag). /// [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Gets metadata pertaining to creation and last modification of the + /// resource. + /// + [JsonProperty(PropertyName = "systemData")] + public DataCollectionRuleResourceSystemData SystemData { get; private set; } + /// /// Validate the object. /// /// /// Thrown if validation fails /// - public override void Validate() + public virtual void Validate() { - base.Validate(); - - if (Destinations == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Destinations"); - } - if (DataFlows == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataFlows"); - } if (Location == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Location"); } - if (DataFlows != null) - { - foreach (var element in DataFlows) - { - if (element != null) - { - element.Validate(); - } - } - } } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResourceSystemData.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResourceSystemData.cs new file mode 100644 index 0000000000000..5679a0abebae5 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResourceSystemData.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.Monitor.Models +{ + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class DataCollectionRuleResourceSystemData : SystemData + { + /// + /// Initializes a new instance of the + /// DataCollectionRuleResourceSystemData class. + /// + public DataCollectionRuleResourceSystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataCollectionRuleResourceSystemData 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 DataCollectionRuleResourceSystemData(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?)) + : base(createdBy, createdByType, createdAt, lastModifiedBy, lastModifiedByType, lastModifiedAt) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs index 9415dd42828af..95fb92b006959 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs @@ -1,4 +1,8 @@ // +// 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. @@ -6,7 +10,6 @@ namespace Microsoft.Azure.Management.Monitor.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -31,7 +34,7 @@ public DataFlow() /// List of streams for this data flow. /// List of destinations for this data /// flow. - public DataFlow(IList streams, IList destinations) + public DataFlow(IList streams = default(IList), IList destinations = default(IList)) { Streams = streams; Destinations = destinations; @@ -55,22 +58,5 @@ public DataFlow(IList streams, IList destinations) [JsonProperty(PropertyName = "destinations")] public IList Destinations { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (Destinations == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Destinations"); - } - } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs index f66eda00cfff0..dd5ea93eccfed 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs index 5288b0fb67ecb..9662371eeed27 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs index 93d723887d24e..b8357e4306604 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs @@ -1,4 +1,8 @@ // +// 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. @@ -29,7 +33,7 @@ public DestinationsSpecAzureMonitorMetrics() /// A friendly name for the destination. /// This name should be unique across all destinations (regardless of /// type) within the data collection rule. - public DestinationsSpecAzureMonitorMetrics(string name) + public DestinationsSpecAzureMonitorMetrics(string name = default(string)) : base(name) { CustomInit(); @@ -40,15 +44,5 @@ public DestinationsSpecAzureMonitorMetrics(string name) /// partial void CustomInit(); - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs index 7b8099392e660..8dad3fa1d3f0e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs @@ -35,8 +35,9 @@ public DynamicMetricCriteria() /// /// Name of the criteria. /// Name of the metric. - /// the criteria time aggregation - /// types. + /// the criteria time aggregation types. + /// Possible values include: 'Average', 'Count', 'Minimum', 'Maximum', + /// 'Total' /// The operator used to compare the /// metric value against the threshold. Possible values include: /// 'GreaterThan', 'LessThan', 'GreaterOrLessThan' @@ -57,7 +58,7 @@ public DynamicMetricCriteria() /// Use this option to set the date from /// which to start learning the metric historical data and calculate /// the dynamic thresholds (in ISO8601 format) - public DynamicMetricCriteria(string name, string metricName, object timeAggregation, string operatorProperty, string alertSensitivity, DynamicThresholdFailingPeriods failingPeriods, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?), System.DateTime? ignoreDataBefore = default(System.DateTime?)) + public DynamicMetricCriteria(string name, string metricName, string timeAggregation, string operatorProperty, string alertSensitivity, DynamicThresholdFailingPeriods failingPeriods, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?), System.DateTime? ignoreDataBefore = default(System.DateTime?)) : base(name, metricName, timeAggregation, additionalProperties, metricNamespace, dimensions, skipMetricValidation) { OperatorProperty = operatorProperty; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs index edd022c9f92f1..e760d09e03c98 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs @@ -38,7 +38,7 @@ public EmailReceiver() /// alert schema. /// The receiver status of the e-mail. Possible /// values include: 'NotSpecified', 'Enabled', 'Disabled' - public EmailReceiver(string name, string emailAddress, bool useCommonAlertSchema, ReceiverStatus? status = default(ReceiverStatus?)) + public EmailReceiver(string name, string emailAddress, bool? useCommonAlertSchema = default(bool?), ReceiverStatus? status = default(ReceiverStatus?)) { Name = name; EmailAddress = emailAddress; @@ -69,7 +69,7 @@ public EmailReceiver() /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Gets the receiver status of the e-mail. Possible values include: diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContract.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContract.cs new file mode 100644 index 0000000000000..ef68c2f6c9cbe --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContract.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the format of Error response. + /// + public partial class ErrorContract + { + /// + /// Initializes a new instance of the ErrorContract class. + /// + public ErrorContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorContract class. + /// + /// The error details. + public ErrorContract(ErrorResponse error = default(ErrorResponse)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error details. + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponse Error { get; set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContractException.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContractException.cs new file mode 100644 index 0000000000000..1c4394eebbbec --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContractException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorContract + /// information. + /// + public partial class ErrorContractException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorContract Body { get; set; } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + public ErrorContractException() + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + public ErrorContractException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + /// Inner exception. + public ErrorContractException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorDetail.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..3f8b119e49cf1 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorResponseCommonV2.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorResponseCommonV2.cs new file mode 100644 index 0000000000000..e29f9a3754027 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorResponseCommonV2.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponseCommonV2 + { + /// + /// Initializes a new instance of the ErrorResponseCommonV2 class. + /// + public ErrorResponseCommonV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseCommonV2 class. + /// + /// The error object. + public ErrorResponseCommonV2(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorResponseCommonV2Exception.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorResponseCommonV2Exception.cs new file mode 100644 index 0000000000000..09b041a3d4c13 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorResponseCommonV2Exception.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponseCommonV2 + /// information. + /// + public partial class ErrorResponseCommonV2Exception : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponseCommonV2 Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseCommonV2Exception class. + /// + public ErrorResponseCommonV2Exception() + { + } + + /// + /// Initializes a new instance of the ErrorResponseCommonV2Exception class. + /// + /// The exception message. + public ErrorResponseCommonV2Exception(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseCommonV2Exception class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseCommonV2Exception(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs index be46e72de05a5..66a7939210c6e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs @@ -1,4 +1,8 @@ // +// 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. @@ -31,22 +35,25 @@ public ExtensionDataSource() /// /// Initializes a new instance of the ExtensionDataSource class. /// + /// The name of the VM extension. /// List of streams that this data source will be /// sent to. /// A stream indicates what schema will be used for this data and /// usually what table in Log Analytics the data will be sent /// to. - /// The name of the VM extension. + /// The extension settings. The format + /// is specific for particular extension. + /// The list of data sources this + /// extension needs data from. /// A friendly name for the data source. /// This name should be unique across all data sources (regardless of /// type) within the data collection rule. - /// The extension settings. The format - /// is specific for particular extension. - public ExtensionDataSource(IList streams, string extensionName, string name, object extensionSettings = default(object)) + public ExtensionDataSource(string extensionName, IList streams = default(IList), object extensionSettings = default(object), IList inputDataSources = default(IList), string name = default(string)) { Streams = streams; ExtensionName = extensionName; ExtensionSettings = extensionSettings; + InputDataSources = inputDataSources; Name = name; CustomInit(); } @@ -77,6 +84,13 @@ public ExtensionDataSource() [JsonProperty(PropertyName = "extensionSettings")] public object ExtensionSettings { get; set; } + /// + /// Gets or sets the list of data sources this extension needs data + /// from. + /// + [JsonProperty(PropertyName = "inputDataSources")] + public IList InputDataSources { get; set; } + /// /// Gets or sets a friendly name for the data source. /// This name should be unique across all data sources (regardless of @@ -93,18 +107,10 @@ public ExtensionDataSource() /// public virtual void Validate() { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } if (ExtensionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ExtensionName"); } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionEndpointProvisioningState.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionEndpointProvisioningState.cs new file mode 100644 index 0000000000000..5644889fb4c31 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionEndpointProvisioningState.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownDataCollectionEndpointProvisioningState. + /// + public static class KnownDataCollectionEndpointProvisioningState + { + public const string Creating = "Creating"; + public const string Updating = "Updating"; + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionEndpointResourceKind.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionEndpointResourceKind.cs new file mode 100644 index 0000000000000..6b69c2c0ec282 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionEndpointResourceKind.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownDataCollectionEndpointResourceKind. + /// + public static class KnownDataCollectionEndpointResourceKind + { + public const string Linux = "Linux"; + public const string Windows = "Windows"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleAssociationProvisioningState.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleAssociationProvisioningState.cs new file mode 100644 index 0000000000000..c52fb28d370a1 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleAssociationProvisioningState.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownDataCollectionRuleAssociationProvisioningState. + /// + public static class KnownDataCollectionRuleAssociationProvisioningState + { + public const string Creating = "Creating"; + public const string Updating = "Updating"; + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleProvisioningState.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleProvisioningState.cs new file mode 100644 index 0000000000000..05e0d514f0b53 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleProvisioningState.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownDataCollectionRuleProvisioningState. + /// + public static class KnownDataCollectionRuleProvisioningState + { + public const string Creating = "Creating"; + public const string Updating = "Updating"; + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleResourceKind.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleResourceKind.cs new file mode 100644 index 0000000000000..beefb8bc51076 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataCollectionRuleResourceKind.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownDataCollectionRuleResourceKind. + /// + public static class KnownDataCollectionRuleResourceKind + { + public const string Linux = "Linux"; + public const string Windows = "Windows"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataFlowStreams.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataFlowStreams.cs new file mode 100644 index 0000000000000..44cf57468999e --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownDataFlowStreams.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownDataFlowStreams. + /// + public static class KnownDataFlowStreams + { + public const string MicrosoftEvent = "Microsoft-Event"; + public const string MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics"; + public const string MicrosoftPerf = "Microsoft-Perf"; + public const string MicrosoftSyslog = "Microsoft-Syslog"; + public const string MicrosoftWindowsEvent = "Microsoft-WindowsEvent"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownExtensionDataSourceStreams.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownExtensionDataSourceStreams.cs new file mode 100644 index 0000000000000..32cfd6f3447d6 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownExtensionDataSourceStreams.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownExtensionDataSourceStreams. + /// + public static class KnownExtensionDataSourceStreams + { + public const string MicrosoftEvent = "Microsoft-Event"; + public const string MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics"; + public const string MicrosoftPerf = "Microsoft-Perf"; + public const string MicrosoftSyslog = "Microsoft-Syslog"; + public const string MicrosoftWindowsEvent = "Microsoft-WindowsEvent"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownPerfCounterDataSourceStreams.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownPerfCounterDataSourceStreams.cs new file mode 100644 index 0000000000000..29ba4c765443a --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownPerfCounterDataSourceStreams.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownPerfCounterDataSourceStreams. + /// + public static class KnownPerfCounterDataSourceStreams + { + public const string MicrosoftPerf = "Microsoft-Perf"; + public const string MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownPublicNetworkAccessOptions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownPublicNetworkAccessOptions.cs new file mode 100644 index 0000000000000..2a63811853760 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownPublicNetworkAccessOptions.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownPublicNetworkAccessOptions. + /// + public static class KnownPublicNetworkAccessOptions + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceFacilityNames.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceFacilityNames.cs new file mode 100644 index 0000000000000..7e84096a4ef48 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceFacilityNames.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownSyslogDataSourceFacilityNames. + /// + public static class KnownSyslogDataSourceFacilityNames + { + public const string Auth = "auth"; + public const string Authpriv = "authpriv"; + public const string Cron = "cron"; + public const string Daemon = "daemon"; + public const string Kern = "kern"; + public const string Lpr = "lpr"; + public const string Mail = "mail"; + public const string Mark = "mark"; + public const string News = "news"; + public const string Syslog = "syslog"; + public const string User = "user"; + public const string Uucp = "uucp"; + public const string Local0 = "local0"; + public const string Local1 = "local1"; + public const string Local2 = "local2"; + public const string Local3 = "local3"; + public const string Local4 = "local4"; + public const string Local5 = "local5"; + public const string Local6 = "local6"; + public const string Local7 = "local7"; + public const string Asterisk = "*"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceLogLevels.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceLogLevels.cs new file mode 100644 index 0000000000000..53281979387c3 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceLogLevels.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownSyslogDataSourceLogLevels. + /// + public static class KnownSyslogDataSourceLogLevels + { + public const string Debug = "Debug"; + public const string Info = "Info"; + public const string Notice = "Notice"; + public const string Warning = "Warning"; + public const string Error = "Error"; + public const string Critical = "Critical"; + public const string Alert = "Alert"; + public const string Emergency = "Emergency"; + public const string Asterisk = "*"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceStreams.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceStreams.cs new file mode 100644 index 0000000000000..dee65d84dfc02 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownSyslogDataSourceStreams.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownSyslogDataSourceStreams. + /// + public static class KnownSyslogDataSourceStreams + { + public const string MicrosoftSyslog = "Microsoft-Syslog"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownWindowsEventLogDataSourceStreams.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownWindowsEventLogDataSourceStreams.cs new file mode 100644 index 0000000000000..45d5325823aa4 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/KnownWindowsEventLogDataSourceStreams.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for KnownWindowsEventLogDataSourceStreams. + /// + public static class KnownWindowsEventLogDataSourceStreams + { + public const string MicrosoftWindowsEvent = "Microsoft-WindowsEvent"; + public const string MicrosoftEvent = "Microsoft-Event"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs index 8d2e2410d2a13..ceb55168fe83d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs @@ -1,4 +1,8 @@ // +// 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. @@ -6,7 +10,6 @@ namespace Microsoft.Azure.Management.Monitor.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -28,12 +31,15 @@ public LogAnalyticsDestination() /// /// The resource ID of the Log /// Analytics workspace. + /// The Customer ID of the Log Analytics + /// workspace. /// A friendly name for the destination. /// This name should be unique across all destinations (regardless of /// type) within the data collection rule. - public LogAnalyticsDestination(string workspaceResourceId, string name) + public LogAnalyticsDestination(string workspaceResourceId = default(string), string workspaceId = default(string), string name = default(string)) { WorkspaceResourceId = workspaceResourceId; + WorkspaceId = workspaceId; Name = name; CustomInit(); } @@ -49,6 +55,12 @@ public LogAnalyticsDestination(string workspaceResourceId, string name) [JsonProperty(PropertyName = "workspaceResourceId")] public string WorkspaceResourceId { get; set; } + /// + /// Gets the Customer ID of the Log Analytics workspace. + /// + [JsonProperty(PropertyName = "workspaceId")] + public string WorkspaceId { get; private set; } + /// /// Gets or sets a friendly name for the destination. /// This name should be unique across all destinations (regardless of @@ -57,22 +69,5 @@ public LogAnalyticsDestination(string workspaceResourceId, string name) [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (WorkspaceResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkspaceResourceId"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs index 6c0adfc1c88d9..a516b0394529b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs @@ -31,7 +31,8 @@ public LogMetricTrigger() /// /// Evaluation operation for Metric /// -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: - /// 'GreaterThan', 'LessThan', 'Equal' + /// 'GreaterThanOrEqual', 'LessThanOrEqual', 'GreaterThan', 'LessThan', + /// 'Equal' /// The threshold of the metric /// trigger. /// Metric Trigger Type - 'Consecutive' @@ -54,8 +55,9 @@ public LogMetricTrigger() /// /// Gets or sets evaluation operation for Metric -'GreaterThan' or - /// 'LessThan' or 'Equal'. Possible values include: 'GreaterThan', - /// 'LessThan', 'Equal' + /// 'LessThan' or 'Equal'. Possible values include: + /// 'GreaterThanOrEqual', 'LessThanOrEqual', 'GreaterThan', 'LessThan', + /// 'Equal' /// [JsonProperty(PropertyName = "thresholdOperator")] public string ThresholdOperator { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs index a709d9399b931..166a52e4c6d9b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs @@ -47,6 +47,17 @@ public LogProfileResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// the resource id of the storage /// account to which you would like to send the Activity Log. /// The service bus rule ID of the @@ -54,8 +65,8 @@ public LogProfileResource() /// created for streaming the Activity Log. The rule ID is of the /// format: '{service bus resource ID}/authorizationrules/{key /// name}'. - public LogProfileResource(string location, IList locations, IList categories, RetentionPolicy retentionPolicy, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string)) - : base(location, id, name, type, tags) + public LogProfileResource(string location, IList locations, IList categories, RetentionPolicy retentionPolicy, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string storageAccountId = default(string), string serviceBusRuleId = default(string)) + : base(location, id, name, type, tags, kind, etag) { StorageAccountId = storageAccountId; ServiceBusRuleId = serviceBusRuleId; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs index e206d0bfb9e6b..b7965a832ee03 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs @@ -43,8 +43,28 @@ public LogSearchRuleResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + /// The api-version used when + /// creating this alert rule + /// True if alert rule is legacy + /// Log Analytic rule /// The description of the Log Search /// rule. + /// The display name of the alert + /// rule + /// The flag that indicates whether the + /// alert should be automatically resolved or not. The default is + /// false. /// The flag which indicates whether the Log /// Search rule is enabled. Value should be true or false. Possible /// values include: 'true', 'false' @@ -55,10 +75,14 @@ public LogSearchRuleResource() /// 'Canceled', 'Failed' /// Schedule (Frequency, Time Window) for rule. /// Required for action type - AlertingAction - public LogSearchRuleResource(string location, Source source, Action action, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string enabled = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), string provisioningState = default(string), Schedule schedule = default(Schedule)) - : base(location, id, name, type, tags) + public LogSearchRuleResource(string location, Source source, Action action, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string createdWithApiVersion = default(string), bool? isLegacyLogAnalyticsRule = default(bool?), string description = default(string), string displayName = default(string), bool? autoMitigate = default(bool?), string enabled = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), string provisioningState = default(string), Schedule schedule = default(Schedule)) + : base(location, id, name, type, tags, kind, etag) { + CreatedWithApiVersion = createdWithApiVersion; + IsLegacyLogAnalyticsRule = isLegacyLogAnalyticsRule; Description = description; + DisplayName = displayName; + AutoMitigate = autoMitigate; Enabled = enabled; LastUpdatedTime = lastUpdatedTime; ProvisioningState = provisioningState; @@ -73,12 +97,37 @@ public LogSearchRuleResource() /// partial void CustomInit(); + /// + /// Gets the api-version used when creating this alert rule + /// + [JsonProperty(PropertyName = "properties.createdWithApiVersion")] + public string CreatedWithApiVersion { get; private set; } + + /// + /// Gets true if alert rule is legacy Log Analytic rule + /// + [JsonProperty(PropertyName = "properties.isLegacyLogAnalyticsRule")] + public bool? IsLegacyLogAnalyticsRule { get; private set; } + /// /// Gets or sets the description of the Log Search rule. /// [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + /// + /// Gets or sets the display name of the alert rule + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the flag that indicates whether the alert should be + /// automatically resolved or not. The default is false. + /// + [JsonProperty(PropertyName = "properties.autoMitigate")] + public bool? AutoMitigate { get; set; } + /// /// Gets or sets the flag which indicates whether the Log Search rule /// is enabled. Value should be true or false. Possible values include: diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs index 862a2a8dd73ff..f12ad85de299e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs @@ -38,7 +38,7 @@ public LogicAppReceiver() /// to. /// Indicates whether to use common /// alert schema. - public LogicAppReceiver(string name, string resourceId, string callbackUrl, bool useCommonAlertSchema) + public LogicAppReceiver(string name, string resourceId, string callbackUrl, bool? useCommonAlertSchema = default(bool?)) { Name = name; ResourceId = resourceId; @@ -75,7 +75,7 @@ public LogicAppReceiver(string name, string resourceId, string callbackUrl, bool /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogsIngestionEndpointSpec.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogsIngestionEndpointSpec.cs new file mode 100644 index 0000000000000..9c215fe3b3c76 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogsIngestionEndpointSpec.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the endpoint used for ingesting logs. + /// + public partial class LogsIngestionEndpointSpec + { + /// + /// Initializes a new instance of the LogsIngestionEndpointSpec class. + /// + public LogsIngestionEndpointSpec() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LogsIngestionEndpointSpec class. + /// + /// The endpoint. This property is + /// READ-ONLY. + public LogsIngestionEndpointSpec(string endpoint = default(string)) + { + Endpoint = endpoint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the endpoint. This property is READ-ONLY. + /// + [JsonProperty(PropertyName = "endpoint")] + public string Endpoint { get; private set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs index c2748c6b6bb0d..003ddb21c4c0e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs @@ -37,17 +37,26 @@ public Metric() /// resource. /// the name and the display name of the metric, /// i.e. it is localizable string. - /// the unit of the metric. Possible values include: + /// The unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', /// 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', /// 'MilliCores', 'NanoCores', 'BitsPerSecond' /// the time series returned when a data query /// is performed. - public Metric(string id, string type, LocalizableString name, Unit unit, IList timeseries) + /// Detailed description of this + /// metric. + /// 'Success' or the error details on query + /// failures for this metric. + /// Error message encountered querying this + /// specific metric. + public Metric(string id, string type, LocalizableString name, string unit, IList timeseries, string displayDescription = default(string), string errorCode = default(string), string errorMessage = default(string)) { Id = id; Type = type; Name = name; + DisplayDescription = displayDescription; + ErrorCode = errorCode; + ErrorMessage = errorMessage; Unit = unit; Timeseries = timeseries; CustomInit(); @@ -77,6 +86,26 @@ public Metric(string id, string type, LocalizableString name, Unit unit, IList + /// Gets or sets detailed description of this metric. + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// Gets or sets 'Success' or the error details on query failures for + /// this metric. + /// + [JsonProperty(PropertyName = "errorCode")] + public string ErrorCode { get; set; } + + /// + /// Gets or sets error message encountered querying this specific + /// metric. + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + /// /// Gets or sets the unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', @@ -84,7 +113,7 @@ public Metric(string id, string type, LocalizableString name, Unit unit, IList [JsonProperty(PropertyName = "unit")] - public Unit Unit { get; set; } + public string Unit { get; set; } /// /// Gets or sets the time series returned when a data query is @@ -113,6 +142,10 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } + if (Unit == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Unit"); + } if (Timeseries == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Timeseries"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs index b350094e1de43..34d8307f5947d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs @@ -33,8 +33,9 @@ public MetricAlertAction() /// /// the id of the action group to /// use. - /// The properties of a webhook - /// object. + /// This field allows specifying custom + /// properties, which would be appended to the alert payload sent as + /// input to the webhook. public MetricAlertAction(string actionGroupId = default(string), IDictionary webHookProperties = default(IDictionary)) { ActionGroupId = actionGroupId; @@ -54,7 +55,9 @@ public MetricAlertAction() public string ActionGroupId { get; set; } /// - /// Gets or sets the properties of a webhook object. + /// Gets or sets this field allows specifying custom properties, which + /// would be appended to the alert payload sent as input to the + /// webhook. /// [JsonProperty(PropertyName = "webHookProperties")] public IDictionary WebHookProperties { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs index 1dc4c60ad162d..4a9a864de8885 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs @@ -35,11 +35,11 @@ public MetricAlertResource() /// Initializes a new instance of the MetricAlertResource class. /// /// Resource location - /// the description of the metric alert that - /// will be included in the alert email. /// Alert severity {0, 1, 2, 3, 4} /// the flag that indicates whether the metric /// alert is enabled. + /// the list of resource id's that this metric + /// alert is scoped to. /// how often the metric alert is /// evaluated represented in ISO 8601 duration format. /// the period of time (in ISO 8601 duration @@ -51,14 +51,27 @@ public MetricAlertResource() /// Azure resource name /// Azure resource type /// Resource tags - /// the list of resource id's that this metric - /// alert is scoped to. + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + /// the description of the metric alert that + /// will be included in the alert email. /// the resource type of the target - /// resource(s) on which the alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// resource(s) on which the alert is created/updated. Mandatory if the + /// scope contains a subscription, resource group, or more than one + /// resource. /// the region of the target - /// resource(s) on which the alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// resource(s) on which the alert is created/updated. Mandatory if the + /// scope contains a subscription, resource group, or more than one + /// resource. /// the flag that indicates whether the /// alert should be auto resolved or not. The default is true. /// the array of actions that are performed when @@ -66,8 +79,10 @@ public MetricAlertResource() /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public MetricAlertResource(string location, string description, int severity, bool enabled, System.TimeSpan evaluationFrequency, System.TimeSpan windowSize, MetricAlertCriteria criteria, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList scopes = default(IList), string targetResourceType = default(string), string targetResourceRegion = default(string), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) - : base(location, id, name, type, tags) + /// the value indicating whether this alert + /// rule is migrated. + public MetricAlertResource(string location, int severity, bool enabled, IList scopes, System.TimeSpan evaluationFrequency, System.TimeSpan windowSize, MetricAlertCriteria criteria, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string description = default(string), string targetResourceType = default(string), string targetResourceRegion = default(string), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?), bool? isMigrated = default(bool?)) + : base(location, id, name, type, tags, kind, etag) { Description = description; Severity = severity; @@ -81,6 +96,7 @@ public MetricAlertResource() AutoMitigate = autoMitigate; Actions = actions; LastUpdatedTime = lastUpdatedTime; + IsMigrated = isMigrated; CustomInit(); } @@ -132,16 +148,16 @@ public MetricAlertResource() /// /// Gets or sets the resource type of the target resource(s) on which - /// the alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// the alert is created/updated. Mandatory if the scope contains a + /// subscription, resource group, or more than one resource. /// [JsonProperty(PropertyName = "properties.targetResourceType")] public string TargetResourceType { get; set; } /// /// Gets or sets the region of the target resource(s) on which the - /// alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// alert is created/updated. Mandatory if the scope contains a + /// subscription, resource group, or more than one resource. /// [JsonProperty(PropertyName = "properties.targetResourceRegion")] public string TargetResourceRegion { get; set; } @@ -172,6 +188,12 @@ public MetricAlertResource() [JsonProperty(PropertyName = "properties.lastUpdatedTime")] public System.DateTime? LastUpdatedTime { get; private set; } + /// + /// Gets the value indicating whether this alert rule is migrated. + /// + [JsonProperty(PropertyName = "properties.isMigrated")] + public bool? IsMigrated { get; private set; } + /// /// Validate the object. /// @@ -181,9 +203,9 @@ public MetricAlertResource() public override void Validate() { base.Validate(); - if (Description == null) + if (Scopes == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); + throw new ValidationException(ValidationRules.CannotBeNull, "Scopes"); } if (Criteria == null) { diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs index 7aaaa76ccfd9f..79942cfb0c2bd 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs @@ -34,27 +34,27 @@ public MetricAlertResourcePatch() /// /// Initializes a new instance of the MetricAlertResourcePatch class. /// + /// Resource tags /// the description of the metric alert that /// will be included in the alert email. /// Alert severity {0, 1, 2, 3, 4} /// the flag that indicates whether the metric /// alert is enabled. + /// the list of resource id's that this metric + /// alert is scoped to. /// how often the metric alert is /// evaluated represented in ISO 8601 duration format. /// the period of time (in ISO 8601 duration /// format) that is used to monitor alert activity based on the /// threshold. - /// defines the specific alert criteria - /// information. - /// Resource tags - /// the list of resource id's that this metric - /// alert is scoped to. /// the resource type of the target /// resource(s) on which the alert is created/updated. Mandatory for /// MultipleResourceMultipleMetricCriteria. /// the region of the target /// resource(s) on which the alert is created/updated. Mandatory for /// MultipleResourceMultipleMetricCriteria. + /// defines the specific alert criteria + /// information. /// the flag that indicates whether the /// alert should be auto resolved or not. The default is true. /// the array of actions that are performed when @@ -62,7 +62,9 @@ public MetricAlertResourcePatch() /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public MetricAlertResourcePatch(string description, int severity, bool enabled, System.TimeSpan evaluationFrequency, System.TimeSpan windowSize, MetricAlertCriteria criteria, IDictionary tags = default(IDictionary), IList scopes = default(IList), string targetResourceType = default(string), string targetResourceRegion = default(string), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + /// the value indicating whether this alert + /// rule is migrated. + public MetricAlertResourcePatch(IDictionary tags = default(IDictionary), string description = default(string), int? severity = default(int?), bool? enabled = default(bool?), IList scopes = default(IList), System.TimeSpan? evaluationFrequency = default(System.TimeSpan?), System.TimeSpan? windowSize = default(System.TimeSpan?), string targetResourceType = default(string), string targetResourceRegion = default(string), MetricAlertCriteria criteria = default(MetricAlertCriteria), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?), bool? isMigrated = default(bool?)) { Tags = tags; Description = description; @@ -77,6 +79,7 @@ public MetricAlertResourcePatch() AutoMitigate = autoMitigate; Actions = actions; LastUpdatedTime = lastUpdatedTime; + IsMigrated = isMigrated; CustomInit(); } @@ -102,14 +105,14 @@ public MetricAlertResourcePatch() /// Gets or sets alert severity {0, 1, 2, 3, 4} /// [JsonProperty(PropertyName = "properties.severity")] - public int Severity { get; set; } + public int? Severity { get; set; } /// /// Gets or sets the flag that indicates whether the metric alert is /// enabled. /// [JsonProperty(PropertyName = "properties.enabled")] - public bool Enabled { get; set; } + public bool? Enabled { get; set; } /// /// Gets or sets the list of resource id's that this metric alert is @@ -123,14 +126,14 @@ public MetricAlertResourcePatch() /// ISO 8601 duration format. /// [JsonProperty(PropertyName = "properties.evaluationFrequency")] - public System.TimeSpan EvaluationFrequency { get; set; } + public System.TimeSpan? EvaluationFrequency { get; set; } /// /// Gets or sets the period of time (in ISO 8601 duration format) that /// is used to monitor alert activity based on the threshold. /// [JsonProperty(PropertyName = "properties.windowSize")] - public System.TimeSpan WindowSize { get; set; } + public System.TimeSpan? WindowSize { get; set; } /// /// Gets or sets the resource type of the target resource(s) on which @@ -175,21 +178,10 @@ public MetricAlertResourcePatch() public System.DateTime? LastUpdatedTime { get; private set; } /// - /// Validate the object. + /// Gets the value indicating whether this alert rule is migrated. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Description == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); - } - if (Criteria == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Criteria"); - } - } + [JsonProperty(PropertyName = "properties.isMigrated")] + public bool? IsMigrated { get; private set; } + } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricClass.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricClass.cs new file mode 100644 index 0000000000000..378581566094f --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricClass.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for MetricClass. + /// + public static class MetricClass + { + public const string Availability = "Availability"; + public const string Transactions = "Transactions"; + public const string Errors = "Errors"; + public const string Latency = "Latency"; + public const string Saturation = "Saturation"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs index d595365129bcd..399811c3f81d6 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs @@ -35,8 +35,9 @@ public MetricCriteria() /// /// Name of the criteria. /// Name of the metric. - /// the criteria time aggregation - /// types. + /// the criteria time aggregation types. + /// Possible values include: 'Average', 'Count', 'Minimum', 'Maximum', + /// 'Total' /// the criteria operator. Possible /// values include: 'Equals', 'NotEquals', 'GreaterThan', /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' @@ -49,7 +50,7 @@ public MetricCriteria() /// Allows creating an alert rule on /// a custom metric that isn't yet emitted, by causing the metric /// validation to be skipped. - public MetricCriteria(string name, string metricName, object timeAggregation, string operatorProperty, double threshold, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) + public MetricCriteria(string name, string metricName, string timeAggregation, string operatorProperty, double threshold, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) : base(name, metricName, timeAggregation, additionalProperties, metricNamespace, dimensions, skipMetricValidation) { OperatorProperty = operatorProperty; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs index c94bb5f8bafec..84d38c86e0b40 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs @@ -39,7 +39,14 @@ public MetricDefinition() /// to. /// the name and the display name of the metric, /// i.e. it is a localizable string. - /// the unit of the metric. Possible values include: + /// Detailed description of this + /// metric. + /// Custom category name for this + /// metric. + /// The class of the metric. Possible values + /// include: 'Availability', 'Transactions', 'Errors', 'Latency', + /// 'Saturation' + /// The unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', /// 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', /// 'MilliCores', 'NanoCores', 'BitsPerSecond' @@ -55,12 +62,15 @@ public MetricDefinition() /// definition. /// the name and the display name of the /// dimension, i.e. it is a localizable string. - public MetricDefinition(bool? isDimensionRequired = default(bool?), string resourceId = default(string), string namespaceProperty = default(string), LocalizableString name = default(LocalizableString), Unit? unit = default(Unit?), AggregationType? primaryAggregationType = default(AggregationType?), IList supportedAggregationTypes = default(IList), IList metricAvailabilities = default(IList), string id = default(string), IList dimensions = default(IList)) + public MetricDefinition(bool? isDimensionRequired = default(bool?), string resourceId = default(string), string namespaceProperty = default(string), LocalizableString name = default(LocalizableString), string displayDescription = default(string), string category = default(string), string metricClass = default(string), string unit = default(string), AggregationType? primaryAggregationType = default(AggregationType?), IList supportedAggregationTypes = default(IList), IList metricAvailabilities = default(IList), string id = default(string), IList dimensions = default(IList)) { IsDimensionRequired = isDimensionRequired; ResourceId = resourceId; NamespaceProperty = namespaceProperty; Name = name; + DisplayDescription = displayDescription; + Category = category; + MetricClass = metricClass; Unit = unit; PrimaryAggregationType = primaryAggregationType; SupportedAggregationTypes = supportedAggregationTypes; @@ -101,6 +111,25 @@ public MetricDefinition() [JsonProperty(PropertyName = "name")] public LocalizableString Name { get; set; } + /// + /// Gets or sets detailed description of this metric. + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// Gets or sets custom category name for this metric. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets the class of the metric. Possible values include: + /// 'Availability', 'Transactions', 'Errors', 'Latency', 'Saturation' + /// + [JsonProperty(PropertyName = "metricClass")] + public string MetricClass { get; set; } + /// /// Gets or sets the unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', @@ -108,7 +137,7 @@ public MetricDefinition() /// 'MilliCores', 'NanoCores', 'BitsPerSecond' /// [JsonProperty(PropertyName = "unit")] - public Unit? Unit { get; set; } + public string Unit { get; set; } /// /// Gets or sets the primary aggregation type value defining how to use diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs index 6180e56c91f1f..4cfc95c792a59 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs @@ -29,16 +29,19 @@ public MetricNamespace() /// /// Initializes a new instance of the MetricNamespace class. /// - /// The ID of the metricNamespace. + /// The ID of the metric namespace. /// The type of the namespace. - /// The name of the namespace. + /// The escaped name of the namespace. + /// Kind of namespace. Possible values + /// include: 'Platform', 'Custom', 'Qos' /// Properties which include the fully /// qualified namespace name. - public MetricNamespace(string id = default(string), string type = default(string), string name = default(string), MetricNamespaceName properties = default(MetricNamespaceName)) + public MetricNamespace(string id = default(string), string type = default(string), string name = default(string), string classification = default(string), MetricNamespaceName properties = default(MetricNamespaceName)) { Id = id; Type = type; Name = name; + Classification = classification; Properties = properties; CustomInit(); } @@ -49,7 +52,7 @@ public MetricNamespace() partial void CustomInit(); /// - /// Gets or sets the ID of the metricNamespace. + /// Gets or sets the ID of the metric namespace. /// [JsonProperty(PropertyName = "id")] public string Id { get; set; } @@ -61,11 +64,18 @@ public MetricNamespace() public string Type { get; set; } /// - /// Gets or sets the name of the namespace. + /// Gets or sets the escaped name of the namespace. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// Gets or sets kind of namespace. Possible values include: + /// 'Platform', 'Custom', 'Qos' + /// + [JsonProperty(PropertyName = "classification")] + public string Classification { get; set; } + /// /// Gets or sets properties which include the fully qualified namespace /// name. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricStatisticType.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricStatisticType.cs index a216b1bf4555f..241b24be5fe9c 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricStatisticType.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricStatisticType.cs @@ -28,7 +28,9 @@ public enum MetricStatisticType [EnumMember(Value = "Max")] Max, [EnumMember(Value = "Sum")] - Sum + Sum, + [EnumMember(Value = "Count")] + Count } internal static class MetricStatisticTypeEnumExtension { @@ -49,6 +51,8 @@ internal static string ToSerializedValue(this MetricStatisticType value) return "Max"; case MetricStatisticType.Sum: return "Sum"; + case MetricStatisticType.Count: + return "Count"; } return null; } @@ -65,6 +69,8 @@ internal static string ToSerializedValue(this MetricStatisticType value) return MetricStatisticType.Max; case "Sum": return MetricStatisticType.Sum; + case "Count": + return MetricStatisticType.Count; } return null; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs index 03738b6e53bf5..dc19e4db4a293 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs @@ -42,7 +42,7 @@ public MetricTrigger() /// minute. /// the metric statistic type. How the metrics /// from multiple instances are combined. Possible values include: - /// 'Average', 'Min', 'Max', 'Sum' + /// 'Average', 'Min', 'Max', 'Sum', 'Count' /// the range of time in which instance data /// is collected. This value must be greater than the delay in metric /// collection, which can vary from resource-to-resource. Must be @@ -59,13 +59,18 @@ public MetricTrigger() /// the scale action. /// the namespace of the metric that /// defines what the rule monitors. + /// the location of the resource + /// the rule monitors. /// List of dimension conditions. For example: /// [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. - public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpan timeGrain, MetricStatisticType statistic, System.TimeSpan timeWindow, TimeAggregationType timeAggregation, ComparisonOperationType operatorProperty, double threshold, string metricNamespace = default(string), IList dimensions = default(IList)) + /// a value indicating whether metric + /// should divide per instance. + public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpan timeGrain, MetricStatisticType statistic, System.TimeSpan timeWindow, TimeAggregationType timeAggregation, ComparisonOperationType operatorProperty, double threshold, string metricNamespace = default(string), string metricResourceLocation = default(string), IList dimensions = default(IList), bool? dividePerInstance = default(bool?)) { MetricName = metricName; MetricNamespace = metricNamespace; MetricResourceUri = metricResourceUri; + MetricResourceLocation = metricResourceLocation; TimeGrain = timeGrain; Statistic = statistic; TimeWindow = timeWindow; @@ -73,6 +78,7 @@ public MetricTrigger() OperatorProperty = operatorProperty; Threshold = threshold; Dimensions = dimensions; + DividePerInstance = dividePerInstance; CustomInit(); } @@ -102,6 +108,12 @@ public MetricTrigger() [JsonProperty(PropertyName = "metricResourceUri")] public string MetricResourceUri { get; set; } + /// + /// Gets or sets the location of the resource the rule monitors. + /// + [JsonProperty(PropertyName = "metricResourceLocation")] + public string MetricResourceLocation { get; set; } + /// /// Gets or sets the granularity of metrics the rule monitors. Must be /// one of the predefined values returned from metric definitions for @@ -113,7 +125,7 @@ public MetricTrigger() /// /// Gets or sets the metric statistic type. How the metrics from /// multiple instances are combined. Possible values include: - /// 'Average', 'Min', 'Max', 'Sum' + /// 'Average', 'Min', 'Max', 'Sum', 'Count' /// [JsonProperty(PropertyName = "statistic")] public MetricStatisticType Statistic { get; set; } @@ -158,6 +170,13 @@ public MetricTrigger() [JsonProperty(PropertyName = "dimensions")] public IList Dimensions { get; set; } + /// + /// Gets or sets a value indicating whether metric should divide per + /// instance. + /// + [JsonProperty(PropertyName = "dividePerInstance")] + public bool? DividePerInstance { get; set; } + /// /// Validate the object. /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricUnit.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricUnit.cs new file mode 100644 index 0000000000000..b1233d95500ce --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricUnit.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for MetricUnit. + /// + public static class MetricUnit + { + public const string Count = "Count"; + public const string Bytes = "Bytes"; + public const string Seconds = "Seconds"; + public const string CountPerSecond = "CountPerSecond"; + public const string BytesPerSecond = "BytesPerSecond"; + public const string Percent = "Percent"; + public const string MilliSeconds = "MilliSeconds"; + public const string ByteSeconds = "ByteSeconds"; + public const string Unspecified = "Unspecified"; + public const string Cores = "Cores"; + public const string MilliCores = "MilliCores"; + public const string NanoCores = "NanoCores"; + public const string BitsPerSecond = "BitsPerSecond"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs index f83400684fce2..c94de154af846 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs @@ -34,8 +34,9 @@ public MultiMetricCriteria() /// /// Name of the criteria. /// Name of the metric. - /// the criteria time aggregation - /// types. + /// the criteria time aggregation types. + /// Possible values include: 'Average', 'Count', 'Minimum', 'Maximum', + /// 'Total' /// Unmatched properties from the /// message are deserialized this collection /// Namespace of the metric. @@ -43,7 +44,7 @@ public MultiMetricCriteria() /// Allows creating an alert rule on /// a custom metric that isn't yet emitted, by causing the metric /// validation to be skipped. - public MultiMetricCriteria(string name, string metricName, object timeAggregation, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) + public MultiMetricCriteria(string name, string metricName, string timeAggregation, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) { AdditionalProperties = additionalProperties; Name = name; @@ -86,10 +87,11 @@ public MultiMetricCriteria() public string MetricNamespace { get; set; } /// - /// Gets or sets the criteria time aggregation types. + /// Gets or sets the criteria time aggregation types. Possible values + /// include: 'Average', 'Count', 'Minimum', 'Maximum', 'Total' /// [JsonProperty(PropertyName = "timeAggregation")] - public object TimeAggregation { get; set; } + public string TimeAggregation { get; set; } /// /// Gets or sets list of dimension conditions. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NamespaceClassification.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NamespaceClassification.cs new file mode 100644 index 0000000000000..cf9e86b284917 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NamespaceClassification.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for NamespaceClassification. + /// + public static class NamespaceClassification + { + public const string Platform = "Platform"; + public const string Custom = "Custom"; + public const string Qos = "Qos"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NetworkRuleSet.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NetworkRuleSet.cs new file mode 100644 index 0000000000000..030b279284cbe --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NetworkRuleSet.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the network rules. + /// + public partial class NetworkRuleSet + { + /// + /// Initializes a new instance of the NetworkRuleSet class. + /// + public NetworkRuleSet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkRuleSet class. + /// + /// The configuration to set whether + /// network access from public internet to the endpoints are allowed. + /// Possible values include: 'Enabled', 'Disabled' + public NetworkRuleSet(string publicNetworkAccess = default(string)) + { + PublicNetworkAccess = publicNetworkAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the configuration to set whether network access from + /// public internet to the endpoints are allowed. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs index 6d519443ccec2..03decc5bcaec1 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs @@ -1,4 +1,8 @@ // +// 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. @@ -6,7 +10,6 @@ namespace Microsoft.Azure.Management.Monitor.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -36,10 +39,6 @@ public PerfCounterDataSource() /// A stream indicates what schema will be used for this data and /// usually what table in Log Analytics the data will be sent /// to. - /// The interval between data - /// uploads (scheduled transfers), rounded up to the nearest minute. - /// Possible values include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', - /// 'PT60M' /// The number of seconds /// between consecutive counter measurements (samples). /// A list of specifier names of the @@ -50,10 +49,9 @@ public PerfCounterDataSource() /// A friendly name for the data source. /// This name should be unique across all data sources (regardless of /// type) within the data collection rule. - public PerfCounterDataSource(IList streams, string scheduledTransferPeriod, int samplingFrequencyInSeconds, IList counterSpecifiers, string name) + public PerfCounterDataSource(IList streams = default(IList), int? samplingFrequencyInSeconds = default(int?), IList counterSpecifiers = default(IList), string name = default(string)) { Streams = streams; - ScheduledTransferPeriod = scheduledTransferPeriod; SamplingFrequencyInSeconds = samplingFrequencyInSeconds; CounterSpecifiers = counterSpecifiers; Name = name; @@ -73,20 +71,12 @@ public PerfCounterDataSource(IList streams, string scheduledTransferPeri [JsonProperty(PropertyName = "streams")] public IList Streams { get; set; } - /// - /// Gets or sets the interval between data uploads (scheduled - /// transfers), rounded up to the nearest minute. Possible values - /// include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', 'PT60M' - /// - [JsonProperty(PropertyName = "scheduledTransferPeriod")] - public string ScheduledTransferPeriod { get; set; } - /// /// Gets or sets the number of seconds between consecutive counter /// measurements (samples). /// [JsonProperty(PropertyName = "samplingFrequencyInSeconds")] - public int SamplingFrequencyInSeconds { get; set; } + public int? SamplingFrequencyInSeconds { get; set; } /// /// Gets or sets a list of specifier names of the performance counters @@ -106,38 +96,5 @@ public PerfCounterDataSource(IList streams, string scheduledTransferPeri [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (ScheduledTransferPeriod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ScheduledTransferPeriod"); - } - if (CounterSpecifiers == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "CounterSpecifiers"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (SamplingFrequencyInSeconds > 30) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "SamplingFrequencyInSeconds", 30); - } - if (SamplingFrequencyInSeconds < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "SamplingFrequencyInSeconds", 1); - } - } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs index d3ccce82751b3..c202da09e7dce 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs @@ -38,13 +38,26 @@ public Resource() /// Azure resource name /// Azure resource type /// Resource tags - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string)) { Id = id; Name = name; Type = type; Location = location; Tags = tags; + Kind = kind; + Etag = etag; CustomInit(); } @@ -83,6 +96,27 @@ public Resource() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Gets metadata used by portal/tooling/etc to render different UX + /// experiences for resources of the same type; e.g. ApiApps are a kind + /// of Microsoft.Web/sites type. If supported, the resource provider + /// must validate and persist this value. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Gets the etag field is *not* required. If it is provided in the + /// response body, it must also be provided as a header per the normal + /// etag convention. Entity tags are used for comparing two or more + /// entities from the same requested resource. HTTP/1.1 uses entity + /// tags in the etag (section 14.19), If-Match (section 14.24), + /// If-None-Match (section 14.26), and If-Range (section 14.27) header + /// fields. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ResourceForUpdate.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ResourceForUpdate.cs index 5c42e64be82b1..f54eb1a9741b6 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ResourceForUpdate.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ResourceForUpdate.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs index 93627a8a00db1..da3a9774ea33e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs @@ -37,15 +37,15 @@ public Response() /// separated by '/'. This may be adjusted in the future and returned /// back from what was originally requested. /// the value of the collection. - /// The integer value representing the cost of the - /// query, for data case. + /// The integer value representing the relative cost + /// of the query. /// The interval (window size) for which the /// metric data was returned in. This may be adjusted in the future /// and returned back from what was originally requested. This is not /// present if a metadata request was made. - /// The namespace of the metrics been + /// The namespace of the metrics being /// queried - /// The region of the resource been + /// The region of the resource being /// queried for metrics. public Response(string timespan, IList value, double? cost = default(double?), System.TimeSpan? interval = default(System.TimeSpan?), string namespaceProperty = default(string), string resourceregion = default(string)) { @@ -64,8 +64,8 @@ public Response() partial void CustomInit(); /// - /// Gets or sets the integer value representing the cost of the query, - /// for data case. + /// Gets or sets the integer value representing the relative cost of + /// the query. /// [JsonProperty(PropertyName = "cost")] public double? Cost { get; set; } @@ -89,13 +89,13 @@ public Response() public System.TimeSpan? Interval { get; set; } /// - /// Gets or sets the namespace of the metrics been queried + /// Gets or sets the namespace of the metrics being queried /// [JsonProperty(PropertyName = "namespace")] public string NamespaceProperty { get; set; } /// - /// Gets or sets the region of the resource been queried for metrics. + /// Gets or sets the region of the resource being queried for metrics. /// [JsonProperty(PropertyName = "resourceregion")] public string Resourceregion { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs index 64f93af629caa..aebbde22872ce 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs @@ -32,9 +32,18 @@ public RuleDataSource() /// the resource identifier of the resource /// the rule monitors. **NOTE**: this property cannot be updated for an /// existing rule. - public RuleDataSource(string resourceUri = default(string)) + /// the legacy resource identifier of + /// the resource the rule monitors. **NOTE**: this property cannot be + /// updated for an existing rule. + /// the location of the + /// resource. + /// the namespace of the metric. + public RuleDataSource(string resourceUri = default(string), string legacyResourceId = default(string), string resourceLocation = default(string), string metricNamespace = default(string)) { ResourceUri = resourceUri; + LegacyResourceId = legacyResourceId; + ResourceLocation = resourceLocation; + MetricNamespace = metricNamespace; CustomInit(); } @@ -51,5 +60,25 @@ public RuleDataSource() [JsonProperty(PropertyName = "resourceUri")] public string ResourceUri { get; set; } + /// + /// Gets or sets the legacy resource identifier of the resource the + /// rule monitors. **NOTE**: this property cannot be updated for an + /// existing rule. + /// + [JsonProperty(PropertyName = "legacyResourceId")] + public string LegacyResourceId { get; set; } + + /// + /// Gets or sets the location of the resource. + /// + [JsonProperty(PropertyName = "resourceLocation")] + public string ResourceLocation { get; set; } + + /// + /// Gets or sets the namespace of the metric. + /// + [JsonProperty(PropertyName = "metricNamespace")] + public string MetricNamespace { get; set; } + } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs index f63b7fb514fe5..8c50bf453300a 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs @@ -36,6 +36,12 @@ public RuleManagementEventDataSource() /// the resource identifier of the resource /// the rule monitors. **NOTE**: this property cannot be updated for an /// existing rule. + /// the legacy resource identifier of + /// the resource the rule monitors. **NOTE**: this property cannot be + /// updated for an existing rule. + /// the location of the + /// resource. + /// the namespace of the metric. /// the event name. /// the event source. /// the level. @@ -50,8 +56,8 @@ public RuleManagementEventDataSource() /// match. /// the substatus. /// the claims. - public RuleManagementEventDataSource(string resourceUri = default(string), string eventName = default(string), string eventSource = default(string), string level = default(string), string operationName = default(string), string resourceGroupName = default(string), string resourceProviderName = default(string), string status = default(string), string subStatus = default(string), RuleManagementEventClaimsDataSource claims = default(RuleManagementEventClaimsDataSource)) - : base(resourceUri) + public RuleManagementEventDataSource(string resourceUri = default(string), string legacyResourceId = default(string), string resourceLocation = default(string), string metricNamespace = default(string), string eventName = default(string), string eventSource = default(string), string level = default(string), string operationName = default(string), string resourceGroupName = default(string), string resourceProviderName = default(string), string status = default(string), string subStatus = default(string), RuleManagementEventClaimsDataSource claims = default(RuleManagementEventClaimsDataSource)) + : base(resourceUri, legacyResourceId, resourceLocation, metricNamespace) { EventName = eventName; EventSource = eventSource; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs index d9a2e97448e75..7b650acc4bffa 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs @@ -34,10 +34,16 @@ public RuleMetricDataSource() /// the resource identifier of the resource /// the rule monitors. **NOTE**: this property cannot be updated for an /// existing rule. + /// the legacy resource identifier of + /// the resource the rule monitors. **NOTE**: this property cannot be + /// updated for an existing rule. + /// the location of the + /// resource. + /// the namespace of the metric. /// the name of the metric that defines what /// the rule monitors. - public RuleMetricDataSource(string resourceUri = default(string), string metricName = default(string)) - : base(resourceUri) + public RuleMetricDataSource(string resourceUri = default(string), string legacyResourceId = default(string), string resourceLocation = default(string), string metricNamespace = default(string), string metricName = default(string)) + : base(resourceUri, legacyResourceId, resourceLocation, metricNamespace) { MetricName = metricName; CustomInit(); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleAction.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleAction.cs index f8e59a53dc7f8..9f23316376c8c 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleAction.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleAction.cs @@ -34,7 +34,8 @@ public ScaleAction() /// values include: 'None', 'Increase', 'Decrease' /// the type of action that should occur when the /// scale rule fires. Possible values include: 'ChangeCount', - /// 'PercentChangeCount', 'ExactCount' + /// 'PercentChangeCount', 'ExactCount', + /// 'ServiceAllowedNextValue' /// the amount of time to wait since the last /// scaling action before this action occurs. It must be between 1 week /// and 1 minute in ISO 8601 format. @@ -66,7 +67,7 @@ public ScaleAction() /// /// Gets or sets the type of action that should occur when the scale /// rule fires. Possible values include: 'ChangeCount', - /// 'PercentChangeCount', 'ExactCount' + /// 'PercentChangeCount', 'ExactCount', 'ServiceAllowedNextValue' /// [JsonProperty(PropertyName = "type")] public ScaleType Type { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleType.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleType.cs index 14e8b058ef787..de3dbf23de2fc 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleType.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ScaleType.cs @@ -26,7 +26,9 @@ public enum ScaleType [EnumMember(Value = "PercentChangeCount")] PercentChangeCount, [EnumMember(Value = "ExactCount")] - ExactCount + ExactCount, + [EnumMember(Value = "ServiceAllowedNextValue")] + ServiceAllowedNextValue } internal static class ScaleTypeEnumExtension { @@ -45,6 +47,8 @@ internal static string ToSerializedValue(this ScaleType value) return "PercentChangeCount"; case ScaleType.ExactCount: return "ExactCount"; + case ScaleType.ServiceAllowedNextValue: + return "ServiceAllowedNextValue"; } return null; } @@ -59,6 +63,8 @@ internal static string ToSerializedValue(this ScaleType value) return ScaleType.PercentChangeCount; case "ExactCount": return ScaleType.ExactCount; + case "ServiceAllowedNextValue": + return ScaleType.ServiceAllowedNextValue; } return null; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Sensitivity.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Sensitivity.cs deleted file mode 100644 index 44e3f73a03876..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Sensitivity.cs +++ /dev/null @@ -1,66 +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.Monitor.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for Sensitivity. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum Sensitivity - { - [EnumMember(Value = "Low")] - Low, - [EnumMember(Value = "Medium")] - Medium, - [EnumMember(Value = "High")] - High - } - internal static class SensitivityEnumExtension - { - internal static string ToSerializedValue(this Sensitivity? value) - { - return value == null ? null : ((Sensitivity)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this Sensitivity value) - { - switch( value ) - { - case Sensitivity.Low: - return "Low"; - case Sensitivity.Medium: - return "Medium"; - case Sensitivity.High: - return "High"; - } - return null; - } - - internal static Sensitivity? ParseSensitivity(this string value) - { - switch( value ) - { - case "Low": - return Sensitivity.Low; - case "Medium": - return Sensitivity.Medium; - case "High": - return Sensitivity.High; - } - return null; - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs index f3106d2c8e3df..c8dfe0423bd46 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs @@ -1,4 +1,8 @@ // +// 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. @@ -6,7 +10,6 @@ namespace Microsoft.Azure.Management.Monitor.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -36,11 +39,11 @@ public SyslogDataSource() /// usually what table in Log Analytics the data will be sent /// to. /// The list of facility names. + /// The log levels to collect. /// A friendly name for the data source. /// This name should be unique across all data sources (regardless of /// type) within the data collection rule. - /// The log levels to collect. - public SyslogDataSource(IList streams, IList facilityNames, string name, IList logLevels = default(IList)) + public SyslogDataSource(IList streams = default(IList), IList facilityNames = default(IList), IList logLevels = default(IList), string name = default(string)) { Streams = streams; FacilityNames = facilityNames; @@ -82,26 +85,5 @@ public SyslogDataSource() [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (FacilityNames == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "FacilityNames"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SystemData.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..7b290dceb02d0 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/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.Monitor.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/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs index 24a82423f3121..931c37ed34052 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs @@ -40,14 +40,14 @@ public TimeSeriesBaseline() /// sensitivity. /// The dimensions of this time /// series. - /// The baseline metadata values. - public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadata = default(IList)) + /// The baseline metadata values. + public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadataValues = default(IList)) { Aggregation = aggregation; Dimensions = dimensions; Timestamps = timestamps; Data = data; - Metadata = metadata; + MetadataValues = metadataValues; CustomInit(); } @@ -83,8 +83,8 @@ public TimeSeriesBaseline() /// /// Gets or sets the baseline metadata values. /// - [JsonProperty(PropertyName = "metadata")] - public IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadataValues")] + public IList MetadataValues { get; set; } /// /// Validate the object. @@ -126,9 +126,9 @@ public virtual void Validate() } } } - if (Metadata != null) + if (MetadataValues != null) { - foreach (var element2 in Metadata) + foreach (var element2 in MetadataValues) { if (element2 != null) { diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesInformation.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesInformation.cs deleted file mode 100644 index 4e6eb4bb17b55..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesInformation.cs +++ /dev/null @@ -1,91 +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.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The time series info needed for calculating the baseline. - /// - public partial class TimeSeriesInformation - { - /// - /// Initializes a new instance of the TimeSeriesInformation class. - /// - public TimeSeriesInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimeSeriesInformation class. - /// - /// the list of sensitivities for - /// calculating the baseline. - /// The metric values to calculate the - /// baseline. - /// the array of timestamps of the - /// baselines. - public TimeSeriesInformation(IList sensitivities, IList values, IList timestamps = default(IList)) - { - Sensitivities = sensitivities; - Values = values; - Timestamps = timestamps; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of sensitivities for calculating the - /// baseline. - /// - [JsonProperty(PropertyName = "sensitivities")] - public IList Sensitivities { get; set; } - - /// - /// Gets or sets the metric values to calculate the baseline. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - /// - /// Gets or sets the array of timestamps of the baselines. - /// - [JsonProperty(PropertyName = "timestamps")] - public IList Timestamps { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Sensitivities == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Sensitivities"); - } - if (Values == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Values"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs index c14ebe65e7309..0f486d3525115 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs @@ -31,8 +31,9 @@ public TriggerCondition() /// Initializes a new instance of the TriggerCondition class. /// /// Evaluation operation for rule - - /// 'GreaterThan' or 'LessThan. Possible values include: 'GreaterThan', - /// 'LessThan', 'Equal' + /// 'GreaterThan' or 'LessThan. Possible values include: + /// 'GreaterThanOrEqual', 'LessThanOrEqual', 'GreaterThan', 'LessThan', + /// 'Equal' /// Result or count threshold based on which /// rule should be triggered. /// Trigger condition for metric query @@ -52,8 +53,8 @@ public TriggerCondition() /// /// Gets or sets evaluation operation for rule - 'GreaterThan' or - /// 'LessThan. Possible values include: 'GreaterThan', 'LessThan', - /// 'Equal' + /// 'LessThan. Possible values include: 'GreaterThanOrEqual', + /// 'LessThanOrEqual', 'GreaterThan', 'LessThan', 'Equal' /// [JsonProperty(PropertyName = "thresholdOperator")] public string ThresholdOperator { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Unit.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Unit.cs deleted file mode 100644 index 285e6bd05001f..0000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Unit.cs +++ /dev/null @@ -1,126 +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.Monitor.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for Unit. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum Unit - { - [EnumMember(Value = "Count")] - Count, - [EnumMember(Value = "Bytes")] - Bytes, - [EnumMember(Value = "Seconds")] - Seconds, - [EnumMember(Value = "CountPerSecond")] - CountPerSecond, - [EnumMember(Value = "BytesPerSecond")] - BytesPerSecond, - [EnumMember(Value = "Percent")] - Percent, - [EnumMember(Value = "MilliSeconds")] - MilliSeconds, - [EnumMember(Value = "ByteSeconds")] - ByteSeconds, - [EnumMember(Value = "Unspecified")] - Unspecified, - [EnumMember(Value = "Cores")] - Cores, - [EnumMember(Value = "MilliCores")] - MilliCores, - [EnumMember(Value = "NanoCores")] - NanoCores, - [EnumMember(Value = "BitsPerSecond")] - BitsPerSecond - } - internal static class UnitEnumExtension - { - internal static string ToSerializedValue(this Unit? value) - { - return value == null ? null : ((Unit)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this Unit value) - { - switch( value ) - { - case Unit.Count: - return "Count"; - case Unit.Bytes: - return "Bytes"; - case Unit.Seconds: - return "Seconds"; - case Unit.CountPerSecond: - return "CountPerSecond"; - case Unit.BytesPerSecond: - return "BytesPerSecond"; - case Unit.Percent: - return "Percent"; - case Unit.MilliSeconds: - return "MilliSeconds"; - case Unit.ByteSeconds: - return "ByteSeconds"; - case Unit.Unspecified: - return "Unspecified"; - case Unit.Cores: - return "Cores"; - case Unit.MilliCores: - return "MilliCores"; - case Unit.NanoCores: - return "NanoCores"; - case Unit.BitsPerSecond: - return "BitsPerSecond"; - } - return null; - } - - internal static Unit? ParseUnit(this string value) - { - switch( value ) - { - case "Count": - return Unit.Count; - case "Bytes": - return Unit.Bytes; - case "Seconds": - return Unit.Seconds; - case "CountPerSecond": - return Unit.CountPerSecond; - case "BytesPerSecond": - return Unit.BytesPerSecond; - case "Percent": - return Unit.Percent; - case "MilliSeconds": - return Unit.MilliSeconds; - case "ByteSeconds": - return Unit.ByteSeconds; - case "Unspecified": - return Unit.Unspecified; - case "Cores": - return Unit.Cores; - case "MilliCores": - return Unit.MilliCores; - case "NanoCores": - return Unit.NanoCores; - case "BitsPerSecond": - return Unit.BitsPerSecond; - } - return null; - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs index 6f157dfc42afc..767c0f216607b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs @@ -44,7 +44,7 @@ public WebhookReceiver() /// auth. /// Indicates the tenant id for aad /// auth. - public WebhookReceiver(string name, string serviceUri, bool useCommonAlertSchema, bool? useAadAuth = default(bool?), string objectId = default(string), string identifierUri = default(string), string tenantId = default(string)) + public WebhookReceiver(string name, string serviceUri, bool? useCommonAlertSchema = default(bool?), bool? useAadAuth = default(bool?), string objectId = default(string), string identifierUri = default(string), string tenantId = default(string)) { Name = name; ServiceUri = serviceUri; @@ -78,7 +78,7 @@ public WebhookReceiver() /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Gets or sets indicates whether or not use AAD authentication. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs index 61f6f218370f7..13da324f85078 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs @@ -1,4 +1,8 @@ // +// 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. @@ -6,7 +10,6 @@ namespace Microsoft.Azure.Management.Monitor.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -35,19 +38,14 @@ public WindowsEventLogDataSource() /// A stream indicates what schema will be used for this data and /// usually what table in Log Analytics the data will be sent /// to. - /// The interval between data - /// uploads (scheduled transfers), rounded up to the nearest minute. - /// Possible values include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', - /// 'PT60M' /// A list of Windows Event Log queries in /// XPATH format. /// A friendly name for the data source. /// This name should be unique across all data sources (regardless of /// type) within the data collection rule. - public WindowsEventLogDataSource(IList streams, string scheduledTransferPeriod, IList xPathQueries, string name) + public WindowsEventLogDataSource(IList streams = default(IList), IList xPathQueries = default(IList), string name = default(string)) { Streams = streams; - ScheduledTransferPeriod = scheduledTransferPeriod; XPathQueries = xPathQueries; Name = name; CustomInit(); @@ -66,14 +64,6 @@ public WindowsEventLogDataSource(IList streams, string scheduledTransfer [JsonProperty(PropertyName = "streams")] public IList Streams { get; set; } - /// - /// Gets or sets the interval between data uploads (scheduled - /// transfers), rounded up to the nearest minute. Possible values - /// include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', 'PT60M' - /// - [JsonProperty(PropertyName = "scheduledTransferPeriod")] - public string ScheduledTransferPeriod { get; set; } - /// /// Gets or sets a list of Windows Event Log queries in XPATH format. /// @@ -88,30 +78,5 @@ public WindowsEventLogDataSource(IList streams, string scheduledTransfer [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (ScheduledTransferPeriod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ScheduledTransferPeriod"); - } - if (XPathQueries == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "XPathQueries"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs index aedbcd71c6ab5..099d34cf117d9 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs @@ -47,7 +47,7 @@ public partial class MonitorManagementClient : ServiceClient - /// The Azure subscription Id. + /// The ID of the target subscription. /// public string SubscriptionId { get; set; } @@ -109,11 +109,6 @@ public partial class MonitorManagementClient : ServiceClient public virtual IActionGroupsOperations ActionGroups { get; private set; } - /// - /// Gets the IActivityLogAlertsOperations. - /// - public virtual IActivityLogAlertsOperations ActivityLogAlerts { get; private set; } - /// /// Gets the IActivityLogsOperations. /// @@ -139,11 +134,6 @@ public partial class MonitorManagementClient : ServiceClient public virtual IMetricsOperations Metrics { get; private set; } - /// - /// Gets the IMetricBaselineOperations. - /// - public virtual IMetricBaselineOperations MetricBaseline { get; private set; } - /// /// Gets the IBaselinesOperations. /// @@ -200,15 +190,24 @@ public partial class MonitorManagementClient : ServiceClient - /// Gets the IDataCollectionRules. + /// Gets the IActivityLogAlertsOperations. /// - public virtual IDataCollectionRules DataCollectionRules { get; private set; } + public virtual IActivityLogAlertsOperations ActivityLogAlerts { get; private set; } + + /// + /// Gets the IDataCollectionEndpointsOperations. + /// + public virtual IDataCollectionEndpointsOperations DataCollectionEndpoints { get; private set; } /// - /// Gets the IDataCollectionRuleAssociations. + /// Gets the IDataCollectionRuleAssociationsOperations. /// - public virtual IDataCollectionRuleAssociations DataCollectionRuleAssociations { get; private set; } + public virtual IDataCollectionRuleAssociationsOperations DataCollectionRuleAssociations { get; private set; } + /// + /// Gets the IDataCollectionRulesOperations. + /// + public virtual IDataCollectionRulesOperations DataCollectionRules { get; private set; } /// /// Initializes a new instance of the MonitorManagementClient class. @@ -459,13 +458,11 @@ private void Initialize() DiagnosticSettings = new DiagnosticSettingsOperations(this); DiagnosticSettingsCategory = new DiagnosticSettingsCategoryOperations(this); ActionGroups = new ActionGroupsOperations(this); - ActivityLogAlerts = new ActivityLogAlertsOperations(this); ActivityLogs = new ActivityLogsOperations(this); EventCategories = new EventCategoriesOperations(this); TenantActivityLogs = new TenantActivityLogsOperations(this); MetricDefinitions = new MetricDefinitionsOperations(this); Metrics = new MetricsOperations(this); - MetricBaseline = new MetricBaselineOperations(this); Baselines = new BaselinesOperations(this); MetricAlerts = new MetricAlertsOperations(this); MetricAlertsStatus = new MetricAlertsStatusOperations(this); @@ -477,8 +474,10 @@ private void Initialize() PrivateLinkResources = new PrivateLinkResourcesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); PrivateLinkScopedResources = new PrivateLinkScopedResourcesOperations(this); - DataCollectionRules = new DataCollectionRules(this); - DataCollectionRuleAssociations = new DataCollectionRuleAssociations(this); + ActivityLogAlerts = new ActivityLogAlertsOperations(this); + DataCollectionEndpoints = new DataCollectionEndpointsOperations(this); + DataCollectionRuleAssociations = new DataCollectionRuleAssociationsOperations(this); + DataCollectionRules = new DataCollectionRulesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Operations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Operations.cs index 8e15790a2f9b0..dfccbd1e4bb99 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Operations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Operations.cs @@ -84,7 +84,7 @@ internal Operations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/operations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Insights/operations").ToString(); List _queryParameters = new List(); if (apiVersion != null) { diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs index b7707970f58d2..f23a07af866bc 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -54,7 +54,7 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) /// Gets a private endpoint connection. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -89,10 +89,28 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -257,7 +275,7 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -284,7 +302,7 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -309,7 +327,7 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) /// Gets all private endpoint connections on a private link scope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -341,10 +359,28 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -503,7 +539,7 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -540,10 +576,28 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -723,7 +777,7 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -755,10 +809,28 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs index d07f38630a449..f154ba1862368 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -28,7 +28,7 @@ public static partial class PrivateEndpointConnectionsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -48,7 +48,7 @@ public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -74,7 +74,7 @@ public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -96,7 +96,7 @@ public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConn /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -124,7 +124,7 @@ public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConn /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -144,7 +144,7 @@ public static void Delete(this IPrivateEndpointConnectionsOperations operations, /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -167,7 +167,7 @@ public static void Delete(this IPrivateEndpointConnectionsOperations operations, /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -184,7 +184,7 @@ public static IPage ListByPrivateLinkScope(this IPriv /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -207,7 +207,7 @@ public static IPage ListByPrivateLinkScope(this IPriv /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -229,7 +229,7 @@ public static PrivateEndpointConnection BeginCreateOrUpdate(this IPrivateEndpoin /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -257,7 +257,7 @@ public static PrivateEndpointConnection BeginCreateOrUpdate(this IPrivateEndpoin /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -277,7 +277,7 @@ public static void BeginDelete(this IPrivateEndpointConnectionsOperations operat /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs index 62700162013ce..19abc53f2f064 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs @@ -55,7 +55,7 @@ internal PrivateLinkResourcesOperations(MonitorManagementClient client) /// PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -87,10 +87,28 @@ internal PrivateLinkResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -250,7 +268,7 @@ internal PrivateLinkResourcesOperations(MonitorManagementClient client) /// PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -285,10 +303,28 @@ internal PrivateLinkResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperationsExtensions.cs index dafb85e58f418..60ce383a270c5 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -29,7 +29,7 @@ public static partial class PrivateLinkResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -47,7 +47,7 @@ public static IPage ListByPrivateLinkScope(this IPrivateLin /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -71,7 +71,7 @@ public static IPage ListByPrivateLinkScope(this IPrivateLin /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -92,7 +92,7 @@ public static PrivateLinkResource Get(this IPrivateLinkResourcesOperations opera /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs index 9fdbfc3bdff8a..4ff6cb960b4d7 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs @@ -58,7 +58,7 @@ internal PrivateLinkScopeOperationStatusOperations(MonitorManagementClient clien /// The operation Id. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -91,10 +91,28 @@ internal PrivateLinkScopeOperationStatusOperations(MonitorManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-10-17-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperationsExtensions.cs index e462cde5e7b67..67cfc122b2a18 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperationsExtensions.cs @@ -32,7 +32,7 @@ public static partial class PrivateLinkScopeOperationStatusOperationsExtensions /// The operation Id. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// public static OperationStatus Get(this IPrivateLinkScopeOperationStatusOperations operations, string asyncOperationId, string resourceGroupName) { @@ -50,7 +50,7 @@ public static OperationStatus Get(this IPrivateLinkScopeOperationStatusOperation /// The operation Id. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs index d95c8489f5dce..c7f8454f078dc 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs @@ -54,7 +54,7 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) /// Gets a scoped resource in a private link scope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -89,10 +89,28 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -257,7 +275,7 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -285,7 +303,7 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -310,7 +328,7 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) /// Gets all private endpoint connections on a private link scope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -342,10 +360,28 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -504,7 +540,7 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) /// Approve or reject a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -542,10 +578,28 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -740,7 +794,7 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) /// Deletes a private endpoint connection with a given name. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -772,10 +826,28 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperationsExtensions.cs index 3347d287b5359..9d1eb0b2ef675 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperationsExtensions.cs @@ -28,7 +28,7 @@ public static partial class PrivateLinkScopedResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -48,7 +48,7 @@ public static ScopedResource Get(this IPrivateLinkScopedResourcesOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -74,7 +74,7 @@ public static ScopedResource Get(this IPrivateLinkScopedResourcesOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -97,7 +97,7 @@ public static ScopedResource Get(this IPrivateLinkScopedResourcesOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -126,7 +126,7 @@ public static ScopedResource Get(this IPrivateLinkScopedResourcesOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -146,7 +146,7 @@ public static void Delete(this IPrivateLinkScopedResourcesOperations operations, /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -169,7 +169,7 @@ public static void Delete(this IPrivateLinkScopedResourcesOperations operations, /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -186,7 +186,7 @@ public static IPage ListByPrivateLinkScope(this IPrivateLinkScop /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -209,7 +209,7 @@ public static IPage ListByPrivateLinkScope(this IPrivateLinkScop /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -232,7 +232,7 @@ public static IPage ListByPrivateLinkScope(this IPrivateLinkScop /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -261,7 +261,7 @@ public static IPage ListByPrivateLinkScope(this IPrivateLinkScop /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -281,7 +281,7 @@ public static void BeginDelete(this IPrivateLinkScopedResourcesOperations operat /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs index 31ebf39a4d7b9..198c94b8b6c3d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs @@ -80,6 +80,13 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-10-17-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -230,7 +237,7 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) /// Gets a list of Azure Monitor PrivateLinkScopes within a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -259,10 +266,28 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-10-17-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -415,7 +440,7 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) /// Deletes a Azure Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -437,7 +462,7 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) /// Returns a Azure Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -469,10 +494,28 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -633,7 +676,7 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) /// operation. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -669,10 +712,28 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -865,7 +926,7 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) /// CreateOrUpdate method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -900,10 +961,28 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -1074,7 +1153,7 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) /// Deletes a Azure Monitor PrivateLinkScope. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -1103,10 +1182,28 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperationsExtensions.cs index 9ef341324e7c8..775786a5a3c9d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperationsExtensions.cs @@ -58,7 +58,7 @@ public static IPage List(this IPrivateLinkScopesOp /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// public static IPage ListByResourceGroup(this IPrivateLinkScopesOperations operations, string resourceGroupName) { @@ -72,7 +72,7 @@ public static IPage ListByResourceGroup(this IPriv /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. @@ -92,7 +92,7 @@ public static IPage ListByResourceGroup(this IPriv /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -109,7 +109,7 @@ public static void Delete(this IPrivateLinkScopesOperations operations, string r /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -129,7 +129,7 @@ public static void Delete(this IPrivateLinkScopesOperations operations, string r /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -146,7 +146,7 @@ public static AzureMonitorPrivateLinkScope Get(this IPrivateLinkScopesOperations /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -171,7 +171,7 @@ public static AzureMonitorPrivateLinkScope Get(this IPrivateLinkScopesOperations /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -194,7 +194,7 @@ public static AzureMonitorPrivateLinkScope CreateOrUpdate(this IPrivateLinkScope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -222,7 +222,7 @@ public static AzureMonitorPrivateLinkScope CreateOrUpdate(this IPrivateLinkScope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -243,7 +243,7 @@ public static AzureMonitorPrivateLinkScope CreateOrUpdate(this IPrivateLinkScope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -269,7 +269,7 @@ public static AzureMonitorPrivateLinkScope CreateOrUpdate(this IPrivateLinkScope /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. @@ -286,7 +286,7 @@ public static void BeginDelete(this IPrivateLinkScopesOperations operations, str /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the Azure Monitor PrivateLinkScope resource. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs index 7f8e047880016..f25bbc03d6eb7 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs @@ -55,7 +55,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// Creates or updates an log search rule. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -69,7 +69,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -90,10 +90,28 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -198,11 +216,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -280,7 +298,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// Gets an Log Search rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -291,7 +309,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -312,6 +330,17 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -320,6 +349,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -405,11 +441,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -469,7 +505,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// Update log search Rule. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -483,7 +519,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -504,10 +540,28 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -608,11 +662,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -672,7 +726,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// Deletes a Log Search rule /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -683,7 +737,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -701,6 +755,17 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (ruleName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); @@ -709,6 +774,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -794,11 +866,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -848,7 +920,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -869,6 +941,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -959,11 +1038,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1023,7 +1102,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// List the Log Search rules within a resource group. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// OData parameters to apply to the operation. @@ -1034,7 +1113,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1055,10 +1134,28 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1151,11 +1248,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperationsExtensions.cs index d654ec4b19562..500cbc0d404d8 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperationsExtensions.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class ScheduledQueryRulesOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -51,7 +51,7 @@ public static LogSearchRuleResource CreateOrUpdate(this IScheduledQueryRulesOper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -77,7 +77,7 @@ public static LogSearchRuleResource CreateOrUpdate(this IScheduledQueryRulesOper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -94,7 +94,7 @@ public static LogSearchRuleResource Get(this IScheduledQueryRulesOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -117,7 +117,7 @@ public static LogSearchRuleResource Get(this IScheduledQueryRulesOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -137,7 +137,7 @@ public static LogSearchRuleResource Update(this IScheduledQueryRulesOperations o /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -163,7 +163,7 @@ public static LogSearchRuleResource Update(this IScheduledQueryRulesOperations o /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -180,7 +180,7 @@ public static void Delete(this IScheduledQueryRulesOperations operations, string /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the rule. @@ -234,7 +234,7 @@ public static void Delete(this IScheduledQueryRulesOperations operations, string /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// OData parameters to apply to the operation. @@ -251,7 +251,7 @@ public static void Delete(this IScheduledQueryRulesOperations operations, string /// The operations group for this extension method. /// /// - /// The name of the resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// OData parameters to apply to the operation. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs index 25d90d1590b2e..dc22cacc45984 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs @@ -19,47 +19,36 @@ public static IEnumerable> ApiInfo_MonitorClient { return new Tuple[] { - new Tuple("Insights", "DataCollectionRules", "2019-11-01-preview"), - new Tuple("Insights", "DataCollectionRuleAssociations", "2019-11-01-preview"), + new Tuple("Insights", "ActivityLogs", "2015-04-01"), + new Tuple("Insights", "AlertRules", "2016-03-01"), + new Tuple("Insights", "AutoscaleSettings", "2015-04-01"), + new Tuple("Insights", "Baselines", "2019-03-01"), + new Tuple("Insights", "DataCollectionEndpoints", "2021-04-01"), + new Tuple("Insights", "DataCollectionRuleAssociations", "2021-04-01"), + new Tuple("Insights", "DataCollectionRules", "2021-04-01"), + new Tuple("Insights", "DiagnosticSettings", "2017-05-01-preview"), + new Tuple("Insights", "DiagnosticSettingsCategory", "2017-05-01-preview"), + new Tuple("Insights", "EventCategories", "2015-04-01"), + new Tuple("Insights", "LogProfiles", "2016-03-01"), new Tuple("Insights", "MetricAlerts", "2018-03-01"), new Tuple("Insights", "MetricAlertsStatus", "2018-03-01"), + new Tuple("Insights", "MetricDefinitions", "2018-01-01"), + new Tuple("Insights", "Metrics", "2018-01-01"), + new Tuple("Insights", "Operations", "2015-04-01"), new Tuple("Insights", "PrivateEndpointConnections", "2019-10-17-preview"), new Tuple("Insights", "PrivateLinkResources", "2019-10-17-preview"), new Tuple("Insights", "PrivateLinkScopedResources", "2019-10-17-preview"), + new Tuple("Insights", "TenantActivityLogs", "2015-04-01"), new Tuple("Insights", "VMInsights", "2018-11-27-preview"), new Tuple("insights", "ActionGroups", "2019-06-01"), new Tuple("insights", "ActivityLogAlerts", "2017-04-01"), - new Tuple("insights", "ActivityLogs", "2015-04-01"), new Tuple("insights", "AlertRuleIncidents", "2016-03-01"), - new Tuple("insights", "AlertRules", "2016-03-01"), - new Tuple("insights", "AutoscaleSettings", "2015-04-01"), - new Tuple("insights", "Baselines", "2019-03-01"), - new Tuple("insights", "DiagnosticSettings", "2017-05-01-preview"), - new Tuple("insights", "DiagnosticSettingsCategory", "2017-05-01-preview"), - new Tuple("insights", "EventCategories", "2015-04-01"), - new Tuple("insights", "LogProfiles", "2016-03-01"), - new Tuple("insights", "MetricBaseline", "2017-11-01-preview"), - new Tuple("insights", "MetricDefinitions", "2018-01-01"), new Tuple("insights", "MetricNamespaces", "2017-12-01-preview"), - new Tuple("insights", "Metrics", "2018-01-01"), - new Tuple("insights", "Operations", "2015-04-01"), new Tuple("insights", "PrivateLinkScopeOperationStatus", "2019-10-17-preview"), new Tuple("insights", "PrivateLinkScopes", "2019-10-17-preview"), new Tuple("insights", "ScheduledQueryRules", "2018-04-16"), - new Tuple("insights", "TenantActivityLogs", "2015-04-01"), }.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/monitor/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Repos\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "27cc07ddd294d98e05cb301e07a72378df9f87e8"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/TenantActivityLogsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/TenantActivityLogsOperations.cs index ed9e35a8f8e10..3f737aaea922e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/TenantActivityLogsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/TenantActivityLogsOperations.cs @@ -104,7 +104,7 @@ internal TenantActivityLogsOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventtypes/management/values").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Insights/eventtypes/management/values").ToString(); List _queryParameters = new List(); if (odataQuery != null) {