@@ -102,13 +102,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
102
102
{
103
103
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "networkManagerName" ) ;
104
104
}
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
+
112
106
if ( configurationName == null )
113
107
{
114
108
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "configurationName" ) ;
@@ -126,7 +120,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
126
120
}
127
121
}
128
122
129
- string apiVersion = "2024-05 -01" ;
123
+ string apiVersion = "2024-03 -01" ;
130
124
// Tracing
131
125
bool _shouldTrace = Microsoft . Rest . ServiceClientTracing . IsEnabled ;
132
126
string _invocationId = null ;
@@ -227,13 +221,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
227
221
228
222
if ( ( int ) _statusCode != 200 )
229
223
{
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 ) ) ;
231
225
try
232
226
{
233
227
_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 ) ;
235
229
if ( _errorBody != null )
236
230
{
231
+ ex = new Microsoft . Rest . Azure . CloudException ( _errorBody . Message ) ;
237
232
ex . Body = _errorBody ;
238
233
}
239
234
}
@@ -243,6 +238,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
243
238
}
244
239
ex . Request = new Microsoft . Rest . HttpRequestMessageWrapper ( _httpRequest , _requestContent ) ;
245
240
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
+ }
246
245
if ( _shouldTrace )
247
246
{
248
247
Microsoft . Rest . ServiceClientTracing . Error ( _invocationId , ex ) ;
@@ -348,13 +347,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
348
347
{
349
348
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "networkManagerName" ) ;
350
349
}
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
+
358
351
if ( configurationName == null )
359
352
{
360
353
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "configurationName" ) ;
@@ -365,7 +358,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
365
358
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "ruleCollectionName" ) ;
366
359
}
367
360
368
- string apiVersion = "2024-05 -01" ;
361
+ string apiVersion = "2024-03 -01" ;
369
362
// Tracing
370
363
bool _shouldTrace = Microsoft . Rest . ServiceClientTracing . IsEnabled ;
371
364
string _invocationId = null ;
@@ -458,13 +451,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
458
451
459
452
if ( ( int ) _statusCode != 200 )
460
453
{
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 ) ) ;
462
455
try
463
456
{
464
457
_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 ) ;
466
459
if ( _errorBody != null )
467
460
{
461
+ ex = new Microsoft . Rest . Azure . CloudException ( _errorBody . Message ) ;
468
462
ex . Body = _errorBody ;
469
463
}
470
464
}
@@ -474,6 +468,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
474
468
}
475
469
ex . Request = new Microsoft . Rest . HttpRequestMessageWrapper ( _httpRequest , _requestContent ) ;
476
470
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
+ }
477
475
if ( _shouldTrace )
478
476
{
479
477
Microsoft . Rest . ServiceClientTracing . Error ( _invocationId , ex ) ;
@@ -587,13 +585,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
587
585
{
588
586
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "networkManagerName" ) ;
589
587
}
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
+
597
589
if ( configurationName == null )
598
590
{
599
591
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "configurationName" ) ;
@@ -604,7 +596,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
604
596
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "ruleCollectionName" ) ;
605
597
}
606
598
607
- string apiVersion = "2024-05 -01" ;
599
+ string apiVersion = "2024-03 -01" ;
608
600
// Tracing
609
601
bool _shouldTrace = Microsoft . Rest . ServiceClientTracing . IsEnabled ;
610
602
string _invocationId = null ;
@@ -704,13 +696,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
704
696
705
697
if ( ( int ) _statusCode != 200 && ( int ) _statusCode != 201 )
706
698
{
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 ) ) ;
708
700
try
709
701
{
710
702
_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 ) ;
712
704
if ( _errorBody != null )
713
705
{
706
+ ex = new Microsoft . Rest . Azure . CloudException ( _errorBody . Message ) ;
714
707
ex . Body = _errorBody ;
715
708
}
716
709
}
@@ -720,6 +713,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
720
713
}
721
714
ex . Request = new Microsoft . Rest . HttpRequestMessageWrapper ( _httpRequest , _requestContent ) ;
722
715
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
+ }
723
720
if ( _shouldTrace )
724
721
{
725
722
Microsoft . Rest . ServiceClientTracing . Error ( _invocationId , ex ) ;
@@ -878,13 +875,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
878
875
{
879
876
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "networkManagerName" ) ;
880
877
}
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
+
888
879
if ( configurationName == null )
889
880
{
890
881
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "configurationName" ) ;
@@ -896,7 +887,7 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
896
887
}
897
888
898
889
899
- string apiVersion = "2024-05 -01" ;
890
+ string apiVersion = "2024-03 -01" ;
900
891
// Tracing
901
892
bool _shouldTrace = Microsoft . Rest . ServiceClientTracing . IsEnabled ;
902
893
string _invocationId = null ;
@@ -994,13 +985,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
994
985
995
986
if ( ( int ) _statusCode != 200 && ( int ) _statusCode != 202 && ( int ) _statusCode != 204 )
996
987
{
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 ) ) ;
998
989
try
999
990
{
1000
991
_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 ) ;
1002
993
if ( _errorBody != null )
1003
994
{
995
+ ex = new Microsoft . Rest . Azure . CloudException ( _errorBody . Message ) ;
1004
996
ex . Body = _errorBody ;
1005
997
}
1006
998
}
@@ -1010,6 +1002,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
1010
1002
}
1011
1003
ex . Request = new Microsoft . Rest . HttpRequestMessageWrapper ( _httpRequest , _requestContent ) ;
1012
1004
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
+ }
1013
1009
if ( _shouldTrace )
1014
1010
{
1015
1011
Microsoft . Rest . ServiceClientTracing . Error ( _invocationId , ex ) ;
@@ -1167,13 +1163,14 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
1167
1163
1168
1164
if ( ( int ) _statusCode != 200 )
1169
1165
{
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 ) ) ;
1171
1167
try
1172
1168
{
1173
1169
_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 ) ;
1175
1171
if ( _errorBody != null )
1176
1172
{
1173
+ ex = new Microsoft . Rest . Azure . CloudException ( _errorBody . Message ) ;
1177
1174
ex . Body = _errorBody ;
1178
1175
}
1179
1176
}
@@ -1183,6 +1180,10 @@ internal AdminRuleCollectionsOperations (NetworkManagementClient client)
1183
1180
}
1184
1181
ex . Request = new Microsoft . Rest . HttpRequestMessageWrapper ( _httpRequest , _requestContent ) ;
1185
1182
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
+ }
1186
1187
if ( _shouldTrace )
1187
1188
{
1188
1189
Microsoft . Rest . ServiceClientTracing . Error ( _invocationId , ex ) ;
0 commit comments