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 { MonitorClient } = require("@azure/arm-monitor");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  /**
   * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.<br>The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
   *
   * @summary Get the list of available event categories supported in the Activity Logs Service.<br>The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
   * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json
   */
  async function getEventCategories() {
    const subscriptionId = "00000000-0000-0000-0000-000000000000";
    const credential = new DefaultAzureCredential();
    const client = new MonitorClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.eventCategories.list()) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  getEventCategories().catch(console.error);
  