text: // DO NOT EDIT! This is a generated sample ("Request",  "job_search_create_client_event")
  'use strict';
  
  // [START job_search_create_client_event]
  // [START job_search_create_client_event_core]
  
  const talent = require('@google-cloud/talent').v4;
  
  /**
   * Creates a client event
   *
   * @param projectId {string} Your Google Cloud Project ID
   * @param tenantId {string} Identifier of the Tenant
   * @param requestId {string} A unique ID generated in the API responses.
   * Value should be set to the request_id from an API response.
   * @param eventId {string} A unique identifier, generated by the client application
   */
  function sampleCreateClientEvent(projectId, tenantId, requestId, eventId) {
    const client = new talent.EventServiceClient();
    // const projectId = 'Your Google Cloud Project ID';
    // const tenantId = 'Your Tenant ID (using tenancy is optional)';
    // const requestId = '[request_id from ResponseMetadata]';
    // const eventId = '[Set this to a unique identifier]';
    const formattedParent = client.tenantPath(projectId, tenantId);
  
    // The timestamp of the event as seconds of UTC time since Unix epoch
    // For more information on how to create google.protobuf.Timestamps
    // See: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto
    const seconds = 0;
    const createTime = {
      seconds: seconds,
    };
  
    // The type of event attributed to the behavior of the end user
    const type = 'VIEW';
  
    // List of job names associated with this event
    const jobsElement = 'projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]';
    const jobsElement2 = 'projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]';
    const jobs = [jobsElement, jobsElement2];
    const jobEvent = {
      type: type,
      jobs: jobs,
    };
    const clientEvent = {
      requestId: requestId,
      eventId: eventId,
      createTime: createTime,
      jobEvent: jobEvent,
    };
    const request = {
      parent: formattedParent,
      clientEvent: clientEvent,
    };
    client.createClientEvent(request)
      .then(responses => {
        const response = responses[0];
        console.log(`Created client event`);
      })
      .catch(err => {
        console.error(err);
      });
  }
  
  
  // [END job_search_create_client_event_core]
  // [END job_search_create_client_event]
  // tslint:disable-next-line:no-any
  
  const argv = require(`yargs`)
    .option('project_id', {
      default: 'Your Google Cloud Project ID',
      string: true
    })
    .option('tenant_id', {
      default: 'Your Tenant ID (using tenancy is optional)',
      string: true
    })
    .option('request_id', {
      default: '[request_id from ResponseMetadata]',
      string: true
    })
    .option('event_id', {
      default: '[Set this to a unique identifier]',
      string: true
    })
    .argv;
  
  sampleCreateClientEvent(argv.project_id, argv.tenant_id, argv.request_id, argv.event_id);
  