text: // Copyright 2021 Google LLC
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //      http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  
  'use strict';
  
  function main(parent) {
    // [START aiplatform_v1_generated_IndexEndpointService_ListIndexEndpoints_async]
    /**
     * TODO(developer): Uncomment these variables before running the sample.
     */
    /**
     *  Required. The resource name of the Location from which to list the IndexEndpoints.
     *  Format: `projects/{project}/locations/{location}`
     */
    // const parent = 'abc123'
    /**
     *  Optional. An expression for filtering the results of the request. For field names
     *  both snake_case and camelCase are supported.
     *    * `index_endpoint` supports = and !=. `index_endpoint` represents the
     *       IndexEndpoint ID, ie. the last segment of the IndexEndpoint's
     *       resourcename google.cloud.aiplatform.v1.IndexEndpoint.name.
     *    * `display_name` supports =, != and regex()
     *              (uses re2 (https://github.com/google/re2/wiki/Syntax) syntax)
     *    * `labels` supports general map functions that is:
     *              `labels.key=value` - key:value equality
     *              `labels.key:* or labels:key - key existence
     *               A key including a space must be quoted. `labels."a key"`.
     *  Some examples:
     *    * `index_endpoint="1"`
     *    * `display_name="myDisplayName"`
     *    * `regex(display_name, "^A") -> The display name starts with an A.
     *    * `labels.myKey="myValue"`
     */
    // const filter = 'abc123'
    /**
     *  Optional. The standard list page size.
     */
    // const pageSize = 1234
    /**
     *  Optional. The standard list page token.
     *  Typically obtained via
     *  ListIndexEndpointsResponse.next_page_token google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token  of the previous
     *  IndexEndpointService.ListIndexEndpoints google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints  call.
     */
    // const pageToken = 'abc123'
    /**
     *  Optional. Mask specifying which fields to read.
     */
    // const readMask = {}
  
    // Imports the Aiplatform library
    const {IndexEndpointServiceClient} = require('@google-cloud/aiplatform').v1;
  
    // Instantiates a client
    const aiplatformClient = new IndexEndpointServiceClient();
  
    async function callListIndexEndpoints() {
      // Construct request
      const request = {
        parent,
      };
  
      // Run request
      const iterable = await aiplatformClient.listIndexEndpointsAsync(request);
      for await (const response of iterable) {
        console.log(response);
      }
    }
  
    callListIndexEndpoints();
    // [END aiplatform_v1_generated_IndexEndpointService_ListIndexEndpoints_async]
  }
  
  process.on('unhandledRejection', err => {
    console.error(err.message);
    process.exitCode = 1;
  });
  main(...process.argv.slice(2));
  