@@ -65,7 +65,7 @@ internal NetAppResourceQuotaLimitsOperations (NetAppManagementClient client)
65
65
/// <return>
66
66
/// A response object containing the response body and response headers.
67
67
/// </return>
68
- public async System . Threading . Tasks . Task < Microsoft . Rest . Azure . AzureOperationResponse < System . Collections . Generic . IEnumerable < SubscriptionQuotaItem > > > ListWithHttpMessagesAsync ( string location , System . Collections . Generic . Dictionary < string , System . Collections . Generic . List < string > > customHeaders = null , System . Threading . CancellationToken cancellationToken = default ( System . Threading . CancellationToken ) )
68
+ public async System . Threading . Tasks . Task < Microsoft . Rest . Azure . AzureOperationResponse < Microsoft . Rest . Azure . IPage < SubscriptionQuotaItem > > > ListWithHttpMessagesAsync ( string location , System . Collections . Generic . Dictionary < string , System . Collections . Generic . List < string > > customHeaders = null , System . Threading . CancellationToken cancellationToken = default ( System . Threading . CancellationToken ) )
69
69
{
70
70
71
71
@@ -205,7 +205,7 @@ internal NetAppResourceQuotaLimitsOperations (NetAppManagementClient client)
205
205
throw ex ;
206
206
}
207
207
// Create Result
208
- var _result = new Microsoft . Rest . Azure . AzureOperationResponse < System . Collections . Generic . IEnumerable < SubscriptionQuotaItem > > ( ) ;
208
+ var _result = new Microsoft . Rest . Azure . AzureOperationResponse < Microsoft . Rest . Azure . IPage < SubscriptionQuotaItem > > ( ) ;
209
209
_result . Request = _httpRequest ;
210
210
_result . Response = _httpResponse ;
211
211
@@ -219,7 +219,7 @@ internal NetAppResourceQuotaLimitsOperations (NetAppManagementClient client)
219
219
_responseContent = await _httpResponse . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
220
220
try
221
221
{
222
- _result . Body = Microsoft . Rest . Serialization . SafeJsonConvert . DeserializeObject < Page1 < SubscriptionQuotaItem > > ( _responseContent , this . Client . DeserializationSettings ) ;
222
+ _result . Body = Microsoft . Rest . Serialization . SafeJsonConvert . DeserializeObject < Page < SubscriptionQuotaItem > > ( _responseContent , this . Client . DeserializationSettings ) ;
223
223
}
224
224
catch ( Newtonsoft . Json . JsonException ex )
225
225
{
@@ -298,7 +298,13 @@ internal NetAppResourceQuotaLimitsOperations (NetAppManagementClient client)
298
298
{
299
299
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "quotaLimitName" ) ;
300
300
}
301
-
301
+ if ( quotaLimitName != null )
302
+ {
303
+ if ( ! System . Text . RegularExpressions . Regex . IsMatch ( quotaLimitName , "^[a-zA-Z][a-zA-Z0-9\\ -]{0,62}$" ) )
304
+ {
305
+ throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . Pattern , "quotaLimitName" , "^[a-zA-Z][a-zA-Z0-9\\ -]{0,62}$" ) ;
306
+ }
307
+ }
302
308
if ( this . Client . ApiVersion == null )
303
309
{
304
310
throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "this.Client.ApiVersion" ) ;
@@ -455,6 +461,183 @@ internal NetAppResourceQuotaLimitsOperations (NetAppManagementClient client)
455
461
456
462
457
463
464
+ }
465
+ /// <summary>
466
+ /// Get the default and current limits for quotas
467
+ /// </summary>
468
+ /// <param name='nextPageLink'>
469
+ /// The NextLink from the previous successful call to List operation.
470
+ /// </param>
471
+ /// <param name='customHeaders'>
472
+ /// Headers that will be added to request.
473
+ /// </param>
474
+ /// <param name='cancellationToken'>
475
+ /// The cancellation token.
476
+ /// </param>
477
+ /// <exception cref="Microsoft.Rest.Azure.CloudException">
478
+ /// Thrown when the operation returned an invalid status code
479
+ /// </exception>
480
+ /// <exception cref="Microsoft.Rest.SerializationException">
481
+ /// Thrown when unable to deserialize the response
482
+ /// </exception>
483
+ /// <exception cref="Microsoft.Rest.ValidationException">
484
+ /// Thrown when a required parameter is null
485
+ /// </exception>
486
+ /// <exception cref="System.ArgumentNullException">
487
+ /// Thrown when a required parameter is null
488
+ /// </exception>
489
+ /// <return>
490
+ /// A response object containing the response body and response headers.
491
+ /// </return>
492
+ public async System . Threading . Tasks . Task < Microsoft . Rest . Azure . AzureOperationResponse < Microsoft . Rest . Azure . IPage < SubscriptionQuotaItem > > > ListNextWithHttpMessagesAsync ( string nextPageLink , System . Collections . Generic . Dictionary < string , System . Collections . Generic . List < string > > customHeaders = null , System . Threading . CancellationToken cancellationToken = default ( System . Threading . CancellationToken ) )
493
+ {
494
+
495
+ if ( nextPageLink == null )
496
+ {
497
+ throw new Microsoft . Rest . ValidationException ( Microsoft . Rest . ValidationRules . CannotBeNull , "nextPageLink" ) ;
498
+ }
499
+ // Tracing
500
+ bool _shouldTrace = Microsoft . Rest . ServiceClientTracing . IsEnabled ;
501
+ string _invocationId = null ;
502
+ if ( _shouldTrace )
503
+ {
504
+ _invocationId = Microsoft . Rest . ServiceClientTracing . NextInvocationId . ToString ( ) ;
505
+ System . Collections . Generic . Dictionary < string , object > tracingParameters = new System . Collections . Generic . Dictionary < string , object > ( ) ;
506
+ tracingParameters . Add ( "nextPageLink" , nextPageLink ) ;
507
+
508
+
509
+ tracingParameters . Add ( "cancellationToken" , cancellationToken ) ;
510
+ Microsoft . Rest . ServiceClientTracing . Enter ( _invocationId , this , "ListNext" , tracingParameters ) ;
511
+ }
512
+ // Construct URL
513
+ string _url = "{nextLink}" ;
514
+ _url = _url . Replace ( "{nextLink}" , nextPageLink ) ;
515
+
516
+ System . Collections . Generic . List < string > _queryParameters = new System . Collections . Generic . List < string > ( ) ;
517
+ if ( _queryParameters . Count > 0 )
518
+ {
519
+ _url += ( _url . Contains ( "?" ) ? "&" : "?" ) + string . Join ( "&" , _queryParameters ) ;
520
+ }
521
+ // Create HTTP transport objects
522
+ var _httpRequest = new System . Net . Http . HttpRequestMessage ( ) ;
523
+ System . Net . Http . HttpResponseMessage _httpResponse = null ;
524
+ _httpRequest . Method = new System . Net . Http . HttpMethod ( "GET" ) ;
525
+ _httpRequest . RequestUri = new System . Uri ( _url ) ;
526
+ // Set Headers
527
+ if ( this . Client . GenerateClientRequestId != null && this . Client . GenerateClientRequestId . Value )
528
+ {
529
+ _httpRequest . Headers . TryAddWithoutValidation ( "x-ms-client-request-id" , System . Guid . NewGuid ( ) . ToString ( ) ) ;
530
+ }
531
+ if ( this . Client . AcceptLanguage != null )
532
+ {
533
+ if ( _httpRequest . Headers . Contains ( "accept-language" ) )
534
+ {
535
+ _httpRequest . Headers . Remove ( "accept-language" ) ;
536
+ }
537
+ _httpRequest . Headers . TryAddWithoutValidation ( "accept-language" , this . Client . AcceptLanguage ) ;
538
+ }
539
+
540
+ if ( customHeaders != null )
541
+ {
542
+ foreach ( var _header in customHeaders )
543
+ {
544
+ if ( _httpRequest . Headers . Contains ( _header . Key ) )
545
+ {
546
+ _httpRequest . Headers . Remove ( _header . Key ) ;
547
+ }
548
+ _httpRequest . Headers . TryAddWithoutValidation ( _header . Key , _header . Value ) ;
549
+ }
550
+ }
551
+ // Serialize Request
552
+ string _requestContent = null ;
553
+ // Set Credentials
554
+ if ( this . Client . Credentials != null )
555
+ {
556
+ cancellationToken . ThrowIfCancellationRequested ( ) ;
557
+ await this . Client . Credentials . ProcessHttpRequestAsync ( _httpRequest , cancellationToken ) . ConfigureAwait ( false ) ;
558
+ }
559
+ // Send Request
560
+ if ( _shouldTrace )
561
+ {
562
+ Microsoft . Rest . ServiceClientTracing . SendRequest ( _invocationId , _httpRequest ) ;
563
+ }
564
+ cancellationToken . ThrowIfCancellationRequested ( ) ;
565
+ _httpResponse = await this . Client . HttpClient . SendAsync ( _httpRequest , cancellationToken ) . ConfigureAwait ( false ) ;
566
+ if ( _shouldTrace )
567
+ {
568
+ Microsoft . Rest . ServiceClientTracing . ReceiveResponse ( _invocationId , _httpResponse ) ;
569
+ }
570
+
571
+ System . Net . HttpStatusCode _statusCode = _httpResponse . StatusCode ;
572
+ cancellationToken . ThrowIfCancellationRequested ( ) ;
573
+ string _responseContent = null ;
574
+
575
+ if ( ( int ) _statusCode != 200 )
576
+ {
577
+ var ex = new ErrorResponseException ( string . Format ( "Operation returned an invalid status code '{0}'" , _statusCode ) ) ;
578
+ try
579
+ {
580
+ _responseContent = await _httpResponse . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
581
+ ErrorResponse _errorBody = Microsoft . Rest . Serialization . SafeJsonConvert . DeserializeObject < ErrorResponse > ( _responseContent , this . Client . DeserializationSettings ) ;
582
+ if ( _errorBody != null )
583
+ {
584
+ ex . Body = _errorBody ;
585
+ }
586
+ }
587
+ catch ( Newtonsoft . Json . JsonException )
588
+ {
589
+ // Ignore the exception
590
+ }
591
+ ex . Request = new Microsoft . Rest . HttpRequestMessageWrapper ( _httpRequest , _requestContent ) ;
592
+ ex . Response = new Microsoft . Rest . HttpResponseMessageWrapper ( _httpResponse , _responseContent ) ;
593
+ if ( _shouldTrace )
594
+ {
595
+ Microsoft . Rest . ServiceClientTracing . Error ( _invocationId , ex ) ;
596
+ }
597
+ _httpRequest . Dispose ( ) ;
598
+ if ( _httpResponse != null )
599
+ {
600
+ _httpResponse . Dispose ( ) ;
601
+ }
602
+ throw ex ;
603
+ }
604
+ // Create Result
605
+ var _result = new Microsoft . Rest . Azure . AzureOperationResponse < Microsoft . Rest . Azure . IPage < SubscriptionQuotaItem > > ( ) ;
606
+ _result . Request = _httpRequest ;
607
+ _result . Response = _httpResponse ;
608
+
609
+ if ( _httpResponse . Headers . Contains ( "x-ms-request-id" ) )
610
+ {
611
+ _result . RequestId = _httpResponse . Headers . GetValues ( "x-ms-request-id" ) . FirstOrDefault ( ) ;
612
+ }
613
+ // Deserialize Response
614
+ if ( ( int ) _statusCode == 200 )
615
+ {
616
+ _responseContent = await _httpResponse . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
617
+ try
618
+ {
619
+ _result . Body = Microsoft . Rest . Serialization . SafeJsonConvert . DeserializeObject < Page < SubscriptionQuotaItem > > ( _responseContent , this . Client . DeserializationSettings ) ;
620
+ }
621
+ catch ( Newtonsoft . Json . JsonException ex )
622
+ {
623
+ _httpRequest . Dispose ( ) ;
624
+ if ( _httpResponse != null )
625
+ {
626
+ _httpResponse . Dispose ( ) ;
627
+ }
628
+ throw new Microsoft . Rest . SerializationException ( "Unable to deserialize the response." , _responseContent , ex ) ;
629
+ }
630
+ }
631
+ if ( _shouldTrace )
632
+ {
633
+ Microsoft . Rest . ServiceClientTracing . Exit ( _invocationId , _result ) ;
634
+ }
635
+ return _result ;
636
+
637
+
638
+
639
+
640
+
458
641
}
459
642
}
460
643
}
0 commit comments