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));
///