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 { WebSiteManagementClient } = require("@azure/arm-appservice");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  /**
   * This sample demonstrates how to Description for Gets all legal agreements that user needs to accept before purchasing a domain.
   *
   * @summary Description for Gets all legal agreements that user needs to accept before purchasing a domain.
   * x-ms-original-file: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-03-01/examples/ListTopLevelDomainAgreements.json
   */
  async function listTopLevelDomainAgreements() {
    const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
    const name = "in";
    const agreementOption = {
      forTransfer: false,
      includePrivacy: true,
    };
    const credential = new DefaultAzureCredential();
    const client = new WebSiteManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.topLevelDomains.listAgreements(name, agreementOption)) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  listTopLevelDomainAgreements().catch(console.error);
  