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