// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).

import * as datacatalog from "oci-datacatalog";
import common = require("oci-common");

// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
  try {
    // Create a service client
    const client = new datacatalog.DataCatalogClient({ authenticationDetailsProvider: provider });

    // Create a request and dependent object(s).
    const listJobExecutionsRequest: datacatalog.requests.ListJobExecutionsRequest = {
      catalogId: "ocid1.test.oc1..<unique_ID>EXAMPLE-catalogId-Value",
      jobKey: "EXAMPLE-jobKey-Value",
      lifecycleState: datacatalog.models.JobExecutionState.Succeeded,
      timeCreated: new Date("Tue Mar 01 07:40:36 UTC 2039"),
      timeUpdated: new Date("Thu Mar 18 06:07:08 UTC 2004"),
      createdById: "ocid1.test.oc1..<unique_ID>EXAMPLE-createdById-Value",
      updatedById: "ocid1.test.oc1..<unique_ID>EXAMPLE-updatedById-Value",
      jobType: datacatalog.models.JobType.Harvest,
      subType: "EXAMPLE-subType-Value",
      parentKey: "EXAMPLE-parentKey-Value",
      timeStart: new Date("Thu Aug 17 10:38:09 UTC 2023"),
      timeEnd: new Date("Sun May 24 22:37:06 UTC 2037"),
      errorCode: "EXAMPLE-errorCode-Value",
      errorMessage: "EXAMPLE-errorMessage-Value",
      processKey: "EXAMPLE-processKey-Value",
      externalUrl: "EXAMPLE-externalUrl-Value",
      eventKey: "EXAMPLE-eventKey-Value",
      dataEntityKey: "EXAMPLE-dataEntityKey-Value",
      fields: [datacatalog.requests.ListJobExecutionsRequest.Fields.ScheduleInstanceKey],
      sortBy: datacatalog.requests.ListJobExecutionsRequest.SortBy.Timecreated,
      sortOrder: datacatalog.requests.ListJobExecutionsRequest.SortOrder.Asc,
      limit: 596,
      page: "EXAMPLE-page-Value",
      opcRequestId: "CXTPB3PZCFRSEWM2IE8B<unique_ID>"
    };

    // Send request to the Client.
    const listJobExecutionsResponse = await client.listJobExecutions(listJobExecutionsRequest);
  } catch (error) {
    console.log("listJobExecutions Failed with error  " + error);
  }
})();