async waitForMatchingEmail(matchOptions, opts) {
      opts = opts || {};
      let postBody = matchOptions;
      // verify the required parameter 'matchOptions' is set
      if (matchOptions === undefined || matchOptions === null) {
        throw new Error("Missing the required parameter 'matchOptions' when calling waitForMatchingEmail");
      }

      let pathParams = {
      };
      let queryParams = {
        'count': opts['count'],
        'inboxId': opts['inboxId'],
        'timeout': opts['timeout'],
        'unreadOnly': opts['unreadOnly']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['API_KEY'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = [EmailPreview];

      return this.callApi(
        '/waitForMatchingEmails', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }
/**
     * Wait or return list of emails that match simple matching patterns
     * Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
     * @param {MatchOptions} matchOptions matchOptions
     * @param {Object} opts Optional parameters
     * @param {Number} opts.count Number of emails to wait for. Must be greater that 1
     * @param {String} opts.inboxId Id of the inbox we are fetching emails from
     * @param {Number} opts.timeout Max milliseconds to wait
     * @param {Boolean} opts.unreadOnly Optional filter for unread only (default to false)
     * @return {Promise<Array.<EmailPreview>>}
     */
Wait or return list of emails that match simple matching patterns
Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached.
Wait or return list of emails that match simple matching patterns Perform a search of emails in an inbox with the given patterns . If results match expected count then return or else retry the search until results are found or timeout is reached .
async waitForMatchingEmail(matchOptions, opts) {
      opts = opts || {};
      let postBody = matchOptions;
      if (matchOptions === undefined || matchOptions === null) {
        throw new Error("Missing the required parameter 'matchOptions' when calling waitForMatchingEmail");
      }
      let pathParams = {
      };
      let queryParams = {
        'count': opts['count'],
        'inboxId': opts['inboxId'],
        'timeout': opts['timeout'],
        'unreadOnly': opts['unreadOnly']
      };
      let headerParams = {
      };
      let formParams = {
      };
      let authNames = ['API_KEY'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = [EmailPreview];
      return this.callApi(
        '/waitForMatchingEmails', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }
async waitForMatchingEmail ( matchOptions , opts ) { opts = opts || { } ; let postBody = matchOptions ; if ( matchOptions === undefined || matchOptions === null ) { throw new Error ( "Missing the required parameter 'matchOptions' when calling waitForMatchingEmail" ) ; } let pathParams = { } ; let queryParams = { 'count' : opts [ 'count' ] , 'inboxId' : opts [ 'inboxId' ] , 'timeout' : opts [ 'timeout' ] , 'unreadOnly' : opts [ 'unreadOnly' ] } ; let headerParams = { } ; let formParams = { } ; let authNames = [ 'API_KEY' ] ; let contentTypes = [ 'application/json' ] ; let accepts = [ 'application/json' ] ; let returnType = [ EmailPreview ] ; return this . callApi ( '/waitForMatchingEmails' , 'POST' , pathParams , queryParams , headerParams , formParams , postBody , authNames , contentTypes , accepts , returnType ) ; }
Wait or return list of emails that match simple matching patterns
 Perform a search of emails in an inbox with the given patterns.
Wait or return list of emails that match simple matching patterns Perform a search of emails in an inbox with the given patterns .
// verify the required parameter 'matchOptions' is set