Esempio n. 1
0
 private void TestGetAvailableScopes(string reservationOrderId, string reservationId)
 {
     HttpMockServer.RecordsDirectory = GetSessionsDirectoryPath();
     using (MockContext context = MockContext.Start(this.GetType()))
     {
         var reservationsClient = ReservationsTestUtilities.GetAzureReservationAPIClient(context, new RecordedDelegatingHandler {
             StatusCodeToReturn = HttpStatusCode.OK
         });
         var scopeList = new List <string>();
         scopeList.Add($"/subscriptions/{Common.SubscriptionId}");
         var requestProperties = new AvailableScopeRequestProperties(scopeList);
         var body = new AvailableScopeRequest(requestProperties);
         var res  = reservationsClient.Reservation.AvailableScopes(reservationOrderId, reservationId, body);
     }
 }
 /// <summary>
 /// Get Available Scopes for `Reservation`.
 /// </summary>
 /// <remarks>
 /// Get Available Scopes for `Reservation`.
 ///
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='reservationOrderId'>
 /// Order Id of the reservation
 /// </param>
 /// <param name='reservationId'>
 /// Id of the Reservation Item
 /// </param>
 /// <param name='body'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AvailableScopeProperties> AvailableScopesAsync(this IReservationOperations operations, string reservationOrderId, string reservationId, AvailableScopeRequest body, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AvailableScopesWithHttpMessagesAsync(reservationOrderId, reservationId, body, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get Available Scopes for `Reservation`.
 /// </summary>
 /// <remarks>
 /// Get Available Scopes for `Reservation`.
 ///
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='reservationOrderId'>
 /// Order Id of the reservation
 /// </param>
 /// <param name='reservationId'>
 /// Id of the Reservation Item
 /// </param>
 /// <param name='body'>
 /// </param>
 public static AvailableScopeProperties AvailableScopes(this IReservationOperations operations, string reservationOrderId, string reservationId, AvailableScopeRequest body)
 {
     return(operations.AvailableScopesAsync(reservationOrderId, reservationId, body).GetAwaiter().GetResult());
 }