Skip to content

Commit 7211413

Browse files
authored
Revert "Suppress false positive cred scan (#26793)" (#26807)
This reverts commit 6936a17.
1 parent 27283dc commit 7211413

File tree

634 files changed

+4337
-54711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

634 files changed

+4337
-54711
lines changed

src/Network/Network.Management.Sdk/Generated/AdminRuleCollectionsOperations.cs

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
102102
{
103103
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName");
104104
}
105-
if (networkManagerName != null)
106-
{
107-
if (!System.Text.RegularExpressions.Regex.IsMatch(networkManagerName, "^[a-zA-Z0-9-]*$"))
108-
{
109-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "networkManagerName", "^[a-zA-Z0-9-]*$");
110-
}
111-
}
105+
112106
if (configurationName == null)
113107
{
114108
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName");
@@ -126,7 +120,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
126120
}
127121
}
128122

129-
string apiVersion = "2024-05-01";
123+
string apiVersion = "2024-03-01";
130124
// Tracing
131125
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
132126
string _invocationId = null;
@@ -227,13 +221,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
227221

228222
if ((int)_statusCode != 200)
229223
{
230-
var ex = new CommonErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
224+
var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
231225
try
232226
{
233227
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
234-
CommonErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CommonErrorResponse>(_responseContent, this.Client.DeserializationSettings);
228+
CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
235229
if (_errorBody != null)
236230
{
231+
ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
237232
ex.Body = _errorBody;
238233
}
239234
}
@@ -243,6 +238,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
243238
}
244239
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
245240
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
241+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
242+
{
243+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
244+
}
246245
if (_shouldTrace)
247246
{
248247
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -348,13 +347,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
348347
{
349348
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName");
350349
}
351-
if (networkManagerName != null)
352-
{
353-
if (!System.Text.RegularExpressions.Regex.IsMatch(networkManagerName, "^[a-zA-Z0-9-]*$"))
354-
{
355-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "networkManagerName", "^[a-zA-Z0-9-]*$");
356-
}
357-
}
350+
358351
if (configurationName == null)
359352
{
360353
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName");
@@ -365,7 +358,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
365358
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName");
366359
}
367360

368-
string apiVersion = "2024-05-01";
361+
string apiVersion = "2024-03-01";
369362
// Tracing
370363
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
371364
string _invocationId = null;
@@ -458,13 +451,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
458451

459452
if ((int)_statusCode != 200)
460453
{
461-
var ex = new CommonErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
454+
var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
462455
try
463456
{
464457
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
465-
CommonErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CommonErrorResponse>(_responseContent, this.Client.DeserializationSettings);
458+
CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
466459
if (_errorBody != null)
467460
{
461+
ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
468462
ex.Body = _errorBody;
469463
}
470464
}
@@ -474,6 +468,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
474468
}
475469
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
476470
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
471+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
472+
{
473+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
474+
}
477475
if (_shouldTrace)
478476
{
479477
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -587,13 +585,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
587585
{
588586
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName");
589587
}
590-
if (networkManagerName != null)
591-
{
592-
if (!System.Text.RegularExpressions.Regex.IsMatch(networkManagerName, "^[a-zA-Z0-9-]*$"))
593-
{
594-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "networkManagerName", "^[a-zA-Z0-9-]*$");
595-
}
596-
}
588+
597589
if (configurationName == null)
598590
{
599591
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName");
@@ -604,7 +596,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
604596
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleCollectionName");
605597
}
606598

607-
string apiVersion = "2024-05-01";
599+
string apiVersion = "2024-03-01";
608600
// Tracing
609601
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
610602
string _invocationId = null;
@@ -704,13 +696,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
704696

705697
if ((int)_statusCode != 200 && (int)_statusCode != 201)
706698
{
707-
var ex = new CommonErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
699+
var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
708700
try
709701
{
710702
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
711-
CommonErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CommonErrorResponse>(_responseContent, this.Client.DeserializationSettings);
703+
CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
712704
if (_errorBody != null)
713705
{
706+
ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
714707
ex.Body = _errorBody;
715708
}
716709
}
@@ -720,6 +713,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
720713
}
721714
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
722715
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
716+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
717+
{
718+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
719+
}
723720
if (_shouldTrace)
724721
{
725722
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -878,13 +875,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
878875
{
879876
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkManagerName");
880877
}
881-
if (networkManagerName != null)
882-
{
883-
if (!System.Text.RegularExpressions.Regex.IsMatch(networkManagerName, "^[a-zA-Z0-9-]*$"))
884-
{
885-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "networkManagerName", "^[a-zA-Z0-9-]*$");
886-
}
887-
}
878+
888879
if (configurationName == null)
889880
{
890881
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationName");
@@ -896,7 +887,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
896887
}
897888

898889

899-
string apiVersion = "2024-05-01";
890+
string apiVersion = "2024-03-01";
900891
// Tracing
901892
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
902893
string _invocationId = null;
@@ -994,13 +985,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
994985

995986
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
996987
{
997-
var ex = new CommonErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
988+
var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
998989
try
999990
{
1000991
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
1001-
CommonErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CommonErrorResponse>(_responseContent, this.Client.DeserializationSettings);
992+
CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
1002993
if (_errorBody != null)
1003994
{
995+
ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
1004996
ex.Body = _errorBody;
1005997
}
1006998
}
@@ -1010,6 +1002,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
10101002
}
10111003
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
10121004
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
1005+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
1006+
{
1007+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
1008+
}
10131009
if (_shouldTrace)
10141010
{
10151011
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -1167,13 +1163,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
11671163

11681164
if ((int)_statusCode != 200)
11691165
{
1170-
var ex = new CommonErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
1166+
var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
11711167
try
11721168
{
11731169
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
1174-
CommonErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CommonErrorResponse>(_responseContent, this.Client.DeserializationSettings);
1170+
CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
11751171
if (_errorBody != null)
11761172
{
1173+
ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
11771174
ex.Body = _errorBody;
11781175
}
11791176
}
@@ -1183,6 +1180,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
11831180
}
11841181
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
11851182
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
1183+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
1184+
{
1185+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
1186+
}
11861187
if (_shouldTrace)
11871188
{
11881189
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);

0 commit comments

Comments
 (0)