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 cloudchannel_v1_generated_CloudChannelService_ListOffers_async]
    /**
     * TODO(developer): Uncomment these variables before running the sample.
     */
    /**
     *  Required. The resource name of the reseller account from which to list Offers.
     *  Parent uses the format: accounts/{account_id}.
     */
    // const parent = 'abc123'
    /**
     *  Optional. Requested page size. Server might return fewer results than requested.
     *  If unspecified, returns at most 500 Offers.
     *  The maximum value is 1000; the server will coerce values above 1000.
     */
    // const pageSize = 1234
    /**
     *  Optional. A token for a page of results other than the first page.
     */
    // const pageToken = 'abc123'
    /**
     *  Optional. The expression to filter results by name (name of
     *  the Offer), sku.name (name of the SKU), or sku.product.name (name of the
     *  Product).
     *  Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1
     *  Example 2: name=accounts/a1/offers/o1
     */
    // const filter = 'abc123'
    /**
     *  Optional. The BCP-47 language code. For example, "en-US". The
     *  response will localize in the corresponding language code, if specified.
     *  The default value is "en-US".
     */
    // const languageCode = 'abc123'
  
    // Imports the Channel library
    const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;
  
    // Instantiates a client
    const channelClient = new CloudChannelServiceClient();
  
    async function callListOffers() {
      // Construct request
      const request = {
        parent,
      };
  
      // Run request
      const iterable = await channelClient.listOffersAsync(request);
      for await (const response of iterable) {
        console.log(response);
      }
    }
  
    callListOffers();
    // [END cloudchannel_v1_generated_CloudChannelService_ListOffers_async]
  }
  
  process.on('unhandledRejection', err => {
    console.error(err.message);
    process.exitCode = 1;
  });
  main(...process.argv.slice(2));
  