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 Lists all the packetCoreControlPlanes in a subscription.
   *
   * @summary Lists all the packetCoreControlPlanes in a subscription.
   * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneListBySubscription.json
   */
  const { MobileNetworkManagementClient } = require("@azure/arm-mobilenetwork");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  async function listPacketCoreControlPlanesInASubscription() {
    const subscriptionId = "subid";
    const credential = new DefaultAzureCredential();
    const client = new MobileNetworkManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.packetCoreControlPlanes.listBySubscription()) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  listPacketCoreControlPlanesInASubscription().catch(console.error);
  