text: // Copyright (c) Microsoft Corporation.
  // Licensed under the MIT License.
  
  /**
   * This sample demonstrates how get a list of collections
   *
   * @summary gets a list of collections
   */
  
  const PurviewAccount = require("@azure-rest/purview-Account");
  const { DefaultAzureCredential } = require("@azure/identity");
  const dotenv = require("dotenv");
  
  dotenv.config();
  
  const endpoint = process.env["ENDPOINT"] || "";
  
  async function main() {
    console.log("== List collections sample ==");
    const client = PurviewAccount(endpoint, new DefaultAzureCredential());
  
    const response = await client.path("/collections").get();
  
    if (response.status !== "200") {
      console.log(`GET "/collections" failed with ${response.status}`);
    }
  
    console.log(response.body);
  }
  
  main().catch(console.error);
  