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.
  const { ConsumptionManagementClient } = require("@azure/arm-consumption");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  /**
   * This sample demonstrates how to List of recommendations for purchasing reserved instances.
   *
   * @summary List of recommendations for purchasing reserved instances.
   * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingAccount.json
   */
  async function reservationRecommendationsByBillingAccountLegacy() {
    const subscriptionId = "00000000-0000-0000-0000-000000000000";
    const scope = "providers/Microsoft.Billing/billingAccounts/123456";
    const credential = new DefaultAzureCredential();
    const client = new ConsumptionManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.reservationRecommendations.list(scope)) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  reservationRecommendationsByBillingAccountLegacy().catch(console.error);
  
  /**
   * This sample demonstrates how to List of recommendations for purchasing reserved instances.
   *
   * @summary List of recommendations for purchasing reserved instances.
   * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingProfile.json
   */
  async function reservationRecommendationsByBillingProfileModern() {
    const subscriptionId = "00000000-0000-0000-0000-000000000000";
    const scope = "providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420";
    const credential = new DefaultAzureCredential();
    const client = new ConsumptionManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.reservationRecommendations.list(scope)) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  reservationRecommendationsByBillingProfileModern().catch(console.error);
  
  /**
   * This sample demonstrates how to List of recommendations for purchasing reserved instances.
   *
   * @summary List of recommendations for purchasing reserved instances.
   * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByResourceGroup.json
   */
  async function reservationRecommendationsByResourceGroupLegacy() {
    const subscriptionId = "00000000-0000-0000-0000-000000000000";
    const scope = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup";
    const credential = new DefaultAzureCredential();
    const client = new ConsumptionManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.reservationRecommendations.list(scope)) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  reservationRecommendationsByResourceGroupLegacy().catch(console.error);
  
  /**
   * This sample demonstrates how to List of recommendations for purchasing reserved instances.
   *
   * @summary List of recommendations for purchasing reserved instances.
   * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsBySubscription.json
   */
  async function reservationRecommendationsBySubscriptionLegacy() {
    const subscriptionId = "00000000-0000-0000-0000-000000000000";
    const scope = "subscriptions/00000000-0000-0000-0000-000000000000";
    const credential = new DefaultAzureCredential();
    const client = new ConsumptionManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.reservationRecommendations.list(scope)) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  reservationRecommendationsBySubscriptionLegacy().catch(console.error);
  
  /**
   * This sample demonstrates how to List of recommendations for purchasing reserved instances.
   *
   * @summary List of recommendations for purchasing reserved instances.
   * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json
   */
  async function reservationRecommendationsFilterBySubscriptionForScopeLookBackPeriodLegacy() {
    const subscriptionId = "00000000-0000-0000-0000-000000000000";
    const filter = "properties/scope eq 'Single' AND properties/lookBackPeriod eq 'Last7Days'";
    const scope = "subscriptions/00000000-0000-0000-0000-000000000000";
    const options = { filter };
    const credential = new DefaultAzureCredential();
    const client = new ConsumptionManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.reservationRecommendations.list(scope, options)) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  reservationRecommendationsFilterBySubscriptionForScopeLookBackPeriodLegacy().catch(console.error);
  