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..97e4eaf12a0e1 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs
@@ -105,6 +105,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;
@@ -319,6 +326,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;
@@ -505,6 +519,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;
@@ -672,6 +693,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 (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -866,6 +894,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;
@@ -1044,6 +1079,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;
@@ -1233,6 +1275,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/ActivityLogAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs
index 861e5a5c1e240..3320c92887776 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs
@@ -89,6 +89,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);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -311,6 +318,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);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -497,6 +511,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);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -672,6 +693,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);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -866,6 +894,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;
@@ -1040,6 +1075,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);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
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..e6b628ea59b63 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;
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..7b2a975fc85a5 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs
@@ -101,6 +101,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;
@@ -292,6 +299,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/AlertRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs
index 992f576643d7f..5a1f02578cd2d 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs
@@ -105,6 +105,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 +129,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));
@@ -290,7 +297,7 @@ internal AlertRulesOperations(MonitorManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -316,6 +323,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 +346,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 +415,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 +431,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);
@@ -463,7 +472,7 @@ internal AlertRulesOperations(MonitorManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -492,6 +501,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 +524,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 +593,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 +609,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);
@@ -682,6 +693,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);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -711,7 +729,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));
@@ -876,7 +894,7 @@ internal AlertRulesOperations(MonitorManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -901,6 +919,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;
@@ -916,7 +941,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 +1009,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 +1025,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 +1078,7 @@ internal AlertRulesOperations(MonitorManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1079,6 +1099,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 +1120,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 +1187,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 +1203,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/AutoscaleSettingsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs
index 2d2193992b4bd..e613ac64a9cb5 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs
@@ -87,6 +87,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;
@@ -285,6 +292,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;
@@ -496,6 +510,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;
@@ -667,6 +688,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;
@@ -852,6 +880,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);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -1046,6 +1081,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;
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..c3e5a5f0b47a2 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs
@@ -142,7 +142,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/DataCollectionRuleAssociations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs
deleted file mode 100644
index 4fae9f9b9192a..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs
+++ /dev/null
@@ -1,1010 +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 Microsoft.Rest;
-
- 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;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// DataCollectionRuleAssociations operations.
- ///
- public partial class DataCollectionRuleAssociations : IServiceOperations, IDataCollectionRuleAssociations
- {
- ///
- /// Initializes a new instance of the DataCollectionRuleAssociations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- public DataCollectionRuleAssociations(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 associations for the specified resource.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// 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>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (resourceUri == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri");
- }
- if (resourceUri != null)
- {
- if (resourceUri.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1);
- }
- }
- string apiVersion = "2019-11-01-preview";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceUri", resourceUri);
- tracingParameters.Add("apiVersion", apiVersion);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByResource", tracingParameters);
- }
- // Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations").ToString();
- _url = _url.Replace("{resourceUri}", resourceUri);
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (customHeaders != null)
- {
- foreach (var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse>();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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 name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the data collection rule. 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>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, 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 (!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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName);
- tracingParameters.Add("apiVersion", apiVersion);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByRule", 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/dataCollectionRules/{dataCollectionRuleName}/associations").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (customHeaders != null)
- {
- foreach (var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse>();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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 association.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// The name of the association.
- ///
- ///
- /// Headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- ///
- /// A response object containing the response body and response headers.
- ///
- public async Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (resourceUri == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri");
- }
- if (resourceUri != null)
- {
- if (resourceUri.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1);
- }
- }
- if (associationName == null)
- {
- 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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceUri", resourceUri);
- tracingParameters.Add("associationName", associationName);
- tracingParameters.Add("apiVersion", apiVersion);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
- }
- // Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}").ToString();
- _url = _url.Replace("{resourceUri}", resourceUri);
- _url = _url.Replace("{associationName}", System.Uri.EscapeDataString(associationName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (customHeaders != null)
- {
- foreach (var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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 an association.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// The name of the association.
- ///
- ///
- /// 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 resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (resourceUri == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri");
- }
- if (resourceUri != null)
- {
- if (resourceUri.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1);
- }
- }
- if (associationName == null)
- {
- 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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceUri", resourceUri);
- tracingParameters.Add("associationName", associationName);
- 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("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}").ToString();
- _url = _url.Replace("{resourceUri}", resourceUri);
- _url = _url.Replace("{associationName}", System.Uri.EscapeDataString(associationName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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;
- }
-
- ///
- /// Deletes an association.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// The name of the association.
- ///
- ///
- /// 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 resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (resourceUri == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri");
- }
- if (resourceUri != null)
- {
- if (resourceUri.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1);
- }
- }
- if (associationName == null)
- {
- 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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceUri", resourceUri);
- tracingParameters.Add("associationName", associationName);
- 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("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}").ToString();
- _url = _url.Replace("{resourceUri}", resourceUri);
- _url = _url.Replace("{associationName}", System.Uri.EscapeDataString(associationName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- if (_shouldTrace)
- {
- ServiceClientTracing.Exit(_invocationId, _result);
- }
- return _result;
- }
-
- }
-}
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/DataCollectionRules.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs
deleted file mode 100644
index 8b5de5f0a032a..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs
+++ /dev/null
@@ -1,1262 +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 Microsoft.Rest;
-
- 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;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// DataCollectionRules operations.
- ///
- public partial class DataCollectionRules : IServiceOperations, IDataCollectionRules
- {
- ///
- /// Initializes a new instance of the DataCollectionRules class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- public DataCollectionRules(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 rules 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);
- }
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
- }
- string apiVersion = "2019-11-01-preview";
- // 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/dataCollectionRules").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 += "?" + 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 (customHeaders != null)
- {
- foreach (var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse>();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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.
- ///
- ///
- /// 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 = "2019-11-01-preview";
- // 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/dataCollectionRules").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 += "?" + 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 (customHeaders != null)
- {
- foreach (var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse>();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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 rule.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the data collection rule. 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 dataCollectionRuleName, 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 (!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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName);
- 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/dataCollectionRules/{dataCollectionRuleName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (customHeaders != null)
- {
- foreach (var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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 rule.
- ///
- ///
- /// 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
- ///
- ///
- /// 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 dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), 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 (!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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName);
- 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/dataCollectionRules/{dataCollectionRuleName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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 rule.
- ///
- ///
- /// 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
- ///
- ///
- /// 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 dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), 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 (!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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName);
- 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/dataCollectionRules/{dataCollectionRuleName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- // 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 rule.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the data collection rule. 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 dataCollectionRuleName, 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 (!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";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName);
- 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/dataCollectionRules/{dataCollectionRuleName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName));
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + 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 (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new HttpOperationResponse();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- if (_shouldTrace)
- {
- ServiceClientTracing.Exit(_invocationId, _result);
- }
- return _result;
- }
-
- }
-}
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/IAlertRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs
index 9a365ee836ed7..b795ded7566d1 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs
@@ -66,7 +66,7 @@ public partial interface IAlertRulesOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -88,7 +88,7 @@ public partial interface IAlertRulesOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -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/IDataCollectionRuleAssociations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs
deleted file mode 100644
index cdceddf6a90a9..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs
+++ /dev/null
@@ -1,146 +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 Microsoft.Rest;
-
- using Models;
-
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// DataCollectionRuleAssociations operations.
- ///
- public partial interface IDataCollectionRuleAssociations
- {
- ///
- /// Lists associations for the specified resource.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// 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>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Lists associations for the specified data collection rule.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the data collection rule. 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>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Returns the specified association.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// The name of the association.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Creates or updates an association.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// The name of the association.
- ///
- ///
- /// 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 resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Deletes an association.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// The name of the association.
- ///
- ///
- /// 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));
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs
deleted file mode 100644
index 1002215a1d476..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs
+++ /dev/null
@@ -1,168 +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 Microsoft.Rest;
-
- using Models;
-
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// DataCollectionRules operations.
- ///
- public partial interface IDataCollectionRules
- {
- ///
- /// Lists all data collection rules 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 rules 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 rule.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the data collection rule. 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 dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Creates or updates a data collection rule.
- ///
- ///
- /// 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 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 dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Updates part of a data collection rule.
- ///
- ///
- /// 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 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 dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Deletes a data collection rule.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the data collection rule. 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 dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs
index ec52f97ca1dc8..e16e06fabb0d3 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs
@@ -160,7 +160,7 @@ public partial interface IMetricAlertsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs
index dc566c7a40578..1527303c37e94 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs
@@ -41,7 +41,7 @@ public partial interface IMonitorManagementClient : System.IDisposable
ServiceClientCredentials Credentials { get; }
///
- /// The Azure subscription Id.
+ /// The ID of the target subscription.
///
string SubscriptionId { get; set; }
@@ -169,39 +169,5 @@ public partial interface IMonitorManagementClient : System.IDisposable
///
IVMInsightsOperations VMInsights { get; }
- ///
- /// Gets the IPrivateLinkScopesOperations.
- ///
- IPrivateLinkScopesOperations PrivateLinkScopes { get; }
-
- ///
- /// Gets the IPrivateLinkScopeOperationStatusOperations.
- ///
- IPrivateLinkScopeOperationStatusOperations PrivateLinkScopeOperationStatus { get; }
-
- ///
- /// Gets the IPrivateLinkResourcesOperations.
- ///
- IPrivateLinkResourcesOperations PrivateLinkResources { get; }
-
- ///
- /// Gets the IPrivateEndpointConnectionsOperations.
- ///
- IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; }
-
- ///
- /// Gets the IPrivateLinkScopedResourcesOperations.
- ///
- IPrivateLinkScopedResourcesOperations PrivateLinkScopedResources { get; }
-
- ///
- /// Gets the IDataCollectionRules.
- ///
- IDataCollectionRules DataCollectionRules { get; }
-
- ///
- /// Gets the IDataCollectionRuleAssociations.
- ///
- IDataCollectionRuleAssociations DataCollectionRuleAssociations { get; }
}
}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateEndpointConnectionsOperations.cs
deleted file mode 100644
index a7ba557f35670..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateEndpointConnectionsOperations.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Monitor
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// PrivateEndpointConnectionsOperations operations.
- ///
- public partial interface IPrivateEndpointConnectionsOperations
- {
- ///
- /// Gets a private endpoint connection.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the private endpoint connection.
- ///
- ///
- /// 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 scopeName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Approve or reject a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the private endpoint connection.
- ///
- ///
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string scopeName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Deletes a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the private endpoint connection.
- ///
- ///
- /// 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 scopeName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets all private endpoint connections on a private link scope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// 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>> ListByPrivateLinkScopeWithHttpMessagesAsync(string resourceGroupName, string scopeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Approve or reject a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the private endpoint connection.
- ///
- ///
- ///
- ///
- /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string scopeName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Deletes a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the private endpoint connection.
- ///
- ///
- /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string scopeName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets all private endpoint connections on a private link scope.
- ///
- ///
- /// 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>> ListByPrivateLinkScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkResourcesOperations.cs
deleted file mode 100644
index 0f99e2a8db8cb..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkResourcesOperations.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Monitor
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// PrivateLinkResourcesOperations operations.
- ///
- public partial interface IPrivateLinkResourcesOperations
- {
- ///
- /// Gets the private link resources that need to be created for a Azure
- /// Monitor PrivateLinkScope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// 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>> ListByPrivateLinkScopeWithHttpMessagesAsync(string resourceGroupName, string scopeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets the private link resources that need to be created for a Azure
- /// Monitor PrivateLinkScope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the private link resource.
- ///
- ///
- /// 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 scopeName, string groupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets the private link resources that need to be created for a Azure
- /// Monitor PrivateLinkScope.
- ///
- ///
- /// 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>> ListByPrivateLinkScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopeOperationStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopeOperationStatusOperations.cs
deleted file mode 100644
index 45e67dbd6f896..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopeOperationStatusOperations.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Monitor
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// PrivateLinkScopeOperationStatusOperations operations.
- ///
- public partial interface IPrivateLinkScopeOperationStatusOperations
- {
- ///
- /// Get the status of an azure asynchronous operation associated with a
- /// private link scope operation.
- ///
- ///
- /// The operation Id.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// 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 asyncOperationId, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopedResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopedResourcesOperations.cs
deleted file mode 100644
index 5e9aae6b02e5e..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopedResourcesOperations.cs
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Monitor
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// PrivateLinkScopedResourcesOperations operations.
- ///
- public partial interface IPrivateLinkScopedResourcesOperations
- {
- ///
- /// Gets a scoped resource in a private link scope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the scoped resource object.
- ///
- ///
- /// 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 scopeName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Approve or reject a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the scoped resource object.
- ///
- ///
- /// The resource id of the scoped Azure monitor resource.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string scopeName, string name, string linkedResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Deletes a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the scoped resource object.
- ///
- ///
- /// 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 scopeName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets all private endpoint connections on a private link scope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// 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>> ListByPrivateLinkScopeWithHttpMessagesAsync(string resourceGroupName, string scopeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Approve or reject a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the scoped resource object.
- ///
- ///
- /// The resource id of the scoped Azure monitor resource.
- ///
- ///
- /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string scopeName, string name, string linkedResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Deletes a private endpoint connection with a given name.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// The name of the scoped resource object.
- ///
- ///
- /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string scopeName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets all private endpoint connections on a private link scope.
- ///
- ///
- /// 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>> ListByPrivateLinkScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopesOperations.cs
deleted file mode 100644
index 764f73ca2ff60..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IPrivateLinkScopesOperations.cs
+++ /dev/null
@@ -1,245 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Monitor
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// PrivateLinkScopesOperations operations.
- ///
- public partial interface IPrivateLinkScopesOperations
- {
- ///
- /// Gets a list of all Azure Monitor PrivateLinkScopes within a
- /// subscription.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets a list of Azure Monitor PrivateLinkScopes within a resource
- /// group.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// 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));
- ///
- /// Deletes a Azure Monitor PrivateLinkScope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// 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 scopeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Returns a Azure Monitor PrivateLinkScope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// 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 scopeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You
- /// cannot specify a different value for InstrumentationKey nor AppId
- /// in the Put operation.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// Properties that need to be specified to create or update a Azure
- /// Monitor PrivateLinkScope.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string scopeName, AzureMonitorPrivateLinkScope azureMonitorPrivateLinkScopePayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Updates an existing PrivateLinkScope's tags. To update other fields
- /// use the CreateOrUpdate method.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string scopeName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Deletes a Azure Monitor PrivateLinkScope.
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the Azure Monitor PrivateLinkScope resource.
- ///
- ///
- /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string scopeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets a list of all Azure Monitor PrivateLinkScopes within a
- /// subscription.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets a list of Azure Monitor PrivateLinkScopes within a resource
- /// group.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs
index 22c26c0894b2c..476c7c5993e46 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs
@@ -84,6 +84,13 @@ internal LogProfilesOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
string apiVersion = "2016-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -251,6 +258,13 @@ internal LogProfilesOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
string apiVersion = "2016-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -442,6 +456,13 @@ internal LogProfilesOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
string apiVersion = "2016-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -634,6 +655,13 @@ internal LogProfilesOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (logProfileName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "logProfileName");
@@ -822,6 +850,13 @@ internal LogProfilesOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
string apiVersion = "2016-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs
index 212520cb0f36c..17b69e75be5f8 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs
@@ -80,6 +80,13 @@ internal MetricAlertsOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
string apiVersion = "2018-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -254,6 +261,13 @@ internal MetricAlertsOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -437,6 +451,13 @@ internal MetricAlertsOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -629,6 +650,13 @@ internal MetricAlertsOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -836,6 +864,13 @@ internal MetricAlertsOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -1015,7 +1050,7 @@ internal MetricAlertsOperations(MonitorManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1033,6 +1068,13 @@ internal MetricAlertsOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -1126,14 +1168,13 @@ internal MetricAlertsOperations(MonitorManagementClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1143,10 +1184,6 @@ internal MetricAlertsOperations(MonitorManagementClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs
index 2fc747a557515..09d82122d2005 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs
@@ -86,6 +86,13 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -278,6 +285,13 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs
index 048ca649aaf3c..9cda6059c92ea 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs
@@ -131,7 +131,7 @@ internal MetricBaselineOperations(MonitorManagementClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/baseline/{metricName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/baseline/{metricName}").ToString();
_url = _url.Replace("{resourceUri}", resourceUri);
_url = _url.Replace("{metricName}", System.Uri.EscapeDataString(metricName));
List _queryParameters = new List();
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs
new file mode 100644
index 0000000000000..e2007d5c8ddcd
--- /dev/null
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs
@@ -0,0 +1,25 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Monitor.Models
+{
+
+ ///
+ /// Defines values for AggregationTypeEnum.
+ ///
+ public static class AggregationTypeEnum
+ {
+ public const string Average = "Average";
+ public const string Count = "Count";
+ public const string Minimum = "Minimum";
+ public const string Maximum = "Maximum";
+ public const string Total = "Total";
+ }
+}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs
deleted file mode 100644
index 024b31b45b870..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs
+++ /dev/null
@@ -1,67 +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.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Azure Monitor Metrics destination.
- ///
- public partial class AzureMonitorMetricsDestination
- {
- ///
- /// Initializes a new instance of the AzureMonitorMetricsDestination
- /// class.
- ///
- public AzureMonitorMetricsDestination()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the AzureMonitorMetricsDestination
- /// class.
- ///
- /// A friendly name for the destination.
- /// This name should be unique across all destinations (regardless of
- /// type) within the data collection rule.
- public AzureMonitorMetricsDestination(string name)
- {
- Name = name;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets a friendly name for the destination.
- /// This name should be unique across all destinations (regardless of
- /// type) within the data collection rule.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (Name == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "Name");
- }
- }
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorPrivateLinkScope.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorPrivateLinkScope.cs
deleted file mode 100644
index 47dbcf85231d3..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorPrivateLinkScope.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Monitor.Models
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Serialization;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// An Azure Monitor PrivateLinkScope definition.
- ///
- [Rest.Serialization.JsonTransformation]
- public partial class AzureMonitorPrivateLinkScope : PrivateLinkScopesResource
- {
- ///
- /// Initializes a new instance of the AzureMonitorPrivateLinkScope
- /// class.
- ///
- public AzureMonitorPrivateLinkScope()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the AzureMonitorPrivateLinkScope
- /// class.
- ///
- /// Resource location
- /// Azure resource Id
- /// Azure resource name
- /// Azure resource type
- /// Resource tags
- /// Current state of this
- /// PrivateLinkScope: whether or not is has been provisioned within the
- /// resource group it is defined. Users cannot change this value but
- /// are able to read from it. Values will include Provisioning
- /// ,Succeeded, Canceled and Failed.
- /// List of private endpoint
- /// connections.
- public AzureMonitorPrivateLinkScope(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList privateEndpointConnections = default(IList))
- : base(location, id, name, type, tags)
- {
- ProvisioningState = provisioningState;
- PrivateEndpointConnections = privateEndpointConnections;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets current state of this PrivateLinkScope: whether or not is has
- /// been provisioned within the resource group it is defined. Users
- /// cannot change this value but are able to read from it. Values will
- /// include Provisioning ,Succeeded, Canceled and Failed.
- ///
- [JsonProperty(PropertyName = "properties.provisioningState")]
- public string ProvisioningState { get; private set; }
-
- ///
- /// Gets list of private endpoint connections.
- ///
- [JsonProperty(PropertyName = "properties.privateEndpointConnections")]
- public IList PrivateEndpointConnections { get; private set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public override void Validate()
- {
- base.Validate();
- if (PrivateEndpointConnections != null)
- {
- foreach (var element in PrivateEndpointConnections)
- {
- if (element != null)
- {
- element.Validate();
- }
- }
- }
- }
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs
index 2aefd3ac9a2c3..83a721dd2d132 100644
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs
+++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs
@@ -38,11 +38,14 @@ public Baseline()
/// baseline.
/// The high thresholds of the
/// baseline.
- public Baseline(Sensitivity sensitivity, IList lowThresholds, IList highThresholds)
+ /// the array of timestamps of the
+ /// baselines.
+ public Baseline(Sensitivity sensitivity, IList lowThresholds, IList highThresholds, IList timestamps = default(IList))
{
Sensitivity = sensitivity;
LowThresholds = lowThresholds;
HighThresholds = highThresholds;
+ Timestamps = timestamps;
CustomInit();
}
@@ -70,6 +73,12 @@ public Baseline(Sensitivity sensitivity, IList lowThresholds, IList HighThresholds { get; set; }
+ ///
+ /// Gets or sets the array of timestamps of the baselines.
+ ///
+ [JsonProperty(PropertyName = "timestamps")]
+ public IList Timestamps { get; set; }
+
///
/// Validate the object.
///
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs
deleted file mode 100644
index 96789654534da..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs
+++ /dev/null
@@ -1,96 +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.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
-
- ///
- /// Definition of generic ARM proxy resource.
- ///
- [Rest.Serialization.JsonTransformation]
- public partial class DataCollectionRuleAssociationProxyOnlyResource : ProxyOnlyResource
- {
- ///
- /// Initializes a new instance of the
- /// DataCollectionRuleAssociationProxyOnlyResource class.
- ///
- public DataCollectionRuleAssociationProxyOnlyResource()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the
- /// DataCollectionRuleAssociationProxyOnlyResource class.
- ///
- /// The resource ID of the data
- /// collection rule that is to be associated.
- /// Description of the association.
- /// The resource provisioning state.
- /// Possible values include: 'Creating', 'Updating', 'Deleting',
- /// 'Succeeded', 'Failed'
- /// Fully qualified ID of the resource.
- /// The name of the resource.
- /// The type of the resource.
- /// Resource entity tag (ETag).
- public DataCollectionRuleAssociationProxyOnlyResource(string dataCollectionRuleId, string description = default(string), string provisioningState = default(string), string id = default(string), string name = default(string), string type = default(string), string etag = default(string))
- : base(id, name, type)
- {
- Description = description;
- DataCollectionRuleId = dataCollectionRuleId;
- ProvisioningState = provisioningState;
- Etag = etag;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets description of the association.
- ///
- [JsonProperty(PropertyName = "properties.description")]
- public string Description { get; set; }
-
- ///
- /// Gets or sets the resource ID of the data collection rule that is to
- /// be associated.
- ///
- [JsonProperty(PropertyName = "properties.dataCollectionRuleId")]
- public string DataCollectionRuleId { get; set; }
-
- ///
- /// Gets the resource provisioning state. Possible values include:
- /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed'
- ///
- [JsonProperty(PropertyName = "properties.provisioningState")]
- public string ProvisioningState { get; private set; }
-
- ///
- /// Gets resource entity tag (ETag).
- ///
- [JsonProperty(PropertyName = "etag")]
- public string Etag { get; private set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (DataCollectionRuleId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "DataCollectionRuleId");
- }
- }
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs
deleted file mode 100644
index a8f31f4b717d3..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs
+++ /dev/null
@@ -1,53 +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.Models
-{
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// The specification of data sources.
- /// This property is optional and can be omitted if the rule is meant to be
- /// used via direct calls to the provisioned endpoint.
- ///
- public partial class DataCollectionRuleDataSources : DataSourcesSpec
- {
- ///
- /// Initializes a new instance of the DataCollectionRuleDataSources
- /// class.
- ///
- public DataCollectionRuleDataSources()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DataCollectionRuleDataSources
- /// class.
- ///
- /// The list of performance counter
- /// data source configurations.
- /// The list of Windows Event Log data
- /// source configurations.
- /// The list of Syslog data source
- /// configurations.
- /// The list of Azure VM extension data source
- /// configurations.
- public DataCollectionRuleDataSources(IList performanceCounters = default(IList), IList windowsEventLogs = default(IList), IList syslog = default(IList), IList extensions = default(IList))
- : base(performanceCounters, windowsEventLogs, syslog, extensions)
- {
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs
deleted file mode 100644
index 99cb30cf99024..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs
+++ /dev/null
@@ -1,47 +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.Models
-{
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// The specification of destinations.
- ///
- public partial class DataCollectionRuleDestinations : DestinationsSpec
- {
- ///
- /// Initializes a new instance of the DataCollectionRuleDestinations
- /// class.
- ///
- public DataCollectionRuleDestinations()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DataCollectionRuleDestinations
- /// class.
- ///
- /// List of Log Analytics
- /// destinations.
- /// Azure Monitor Metrics
- /// destination.
- public DataCollectionRuleDestinations(IList logAnalytics = default(IList), DestinationsSpecAzureMonitorMetrics azureMonitorMetrics = default(DestinationsSpecAzureMonitorMetrics))
- : base(logAnalytics, azureMonitorMetrics)
- {
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- }
-}
diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs
deleted file mode 100644
index 4d31b6a37da8b..0000000000000
--- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs
+++ /dev/null
@@ -1,139 +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.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Collections.Generic;
-
- ///
- /// Definition of ARM tracked top level resource.
- ///
- [Rest.Serialization.JsonTransformation]
- public partial class DataCollectionRuleResource : Resource
- {
- ///
- /// Initializes a new instance of the DataCollectionRuleResource class.
- ///
- public DataCollectionRuleResource()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DataCollectionRuleResource class.
- ///
- /// The specification of
- /// destinations.
- /// The specification of data flows.
- /// The geo-location where the resource
- /// lives.
- /// Description of the data collection
- /// rule.
- /// The specification of data sources.
- /// This property is optional and can be omitted if the rule is meant
- /// to be used via direct calls to the provisioned endpoint.
- /// The resource provisioning state.
- /// Possible values include: 'Creating', 'Updating', 'Deleting',
- /// 'Succeeded', 'Failed'
- /// Resource tags.
- /// Fully qualified ID of the resource.
- /// The name of the resource.
- /// The type of the resource.
- /// Resource entity tag (ETag).
- public DataCollectionRuleResource(DataCollectionRuleDestinations destinations, IList dataFlows, string location, string description = default(string), DataCollectionRuleDataSources dataSources = default(DataCollectionRuleDataSources), string provisioningState = default(string), IDictionary tags = default(IDictionary