text: /*
   * Copyright (c) Microsoft Corporation.
   * Licensed under the MIT License.
   *
   * Code generated by Microsoft (R) AutoRest Code Generator.
   * Changes may cause incorrect behavior and will be lost if the code is regenerated.
   */
  
  // Copyright (c) Microsoft Corporation.
  // Licensed under the MIT License.
  /**
   * This sample demonstrates how to List `Reservation`s within a single `ReservationOrder`.
   *
   * @summary List `Reservation`s within a single `ReservationOrder`.
   * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/examples/GetReservationsFromOrder.json
   */
  const { AzureReservationAPI } = require("@azure/arm-reservations");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  async function reservationList() {
    const reservationOrderId = "276e7ae4-84d0-4da6-ab4b-d6b94f3557da";
    const credential = new DefaultAzureCredential();
    const client = new AzureReservationAPI(credential);
    const resArray = new Array();
    for await (let item of client.reservation.list(reservationOrderId)) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  reservationList().catch(console.error);
  