// 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 datasafe from "oci-datasafe";
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 datasafe.DataSafeClient({ authenticationDetailsProvider: provider });

    // Create a request and dependent object(s).
    const listUsersRequest: datasafe.requests.ListUsersRequest = {
      userAssessmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-userAssessmentId-Value",
      limit: 471,
      compartmentIdInSubtree: false,
      accessLevel: datasafe.requests.ListUsersRequest.AccessLevel.Restricted,
      userCategory: "EXAMPLE-userCategory-Value",
      userRole: "EXAMPLE-userRole-Value",
      userProfile: "EXAMPLE-userProfile-Value",
      userType: "EXAMPLE-userType-Value",
      userKey: "EXAMPLE-userKey-Value",
      accountStatus: "EXAMPLE-accountStatus-Value",
      authenticationType: "EXAMPLE-authenticationType-Value",
      userName: "EXAMPLE-userName-Value",
      targetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-targetId-Value",
      timeLastLoginGreaterThanOrEqualTo: new Date("Sat Nov 03 19:14:41 UTC 2012"),
      timeLastLoginLessThan: new Date("Sat Feb 11 00:06:16 UTC 2045"),
      timeUserCreatedGreaterThanOrEqualTo: new Date("Thu Nov 15 13:34:16 UTC 2029"),
      timeUserCreatedLessThan: new Date("Thu Feb 16 10:18:54 UTC 2034"),
      timePasswordLastChangedGreaterThanOrEqualTo: new Date("Sat Dec 10 15:45:05 UTC 2005"),
      timePasswordLastChangedLessThan: new Date("Thu Jun 10 16:27:07 UTC 2010"),
      page: "EXAMPLE-page-Value",
      sortOrder: datasafe.requests.ListUsersRequest.SortOrder.Desc,
      sortBy: datasafe.requests.ListUsersRequest.SortBy.AuthenticationType,
      opcRequestId: "LS8B5EVOW7AE1ZYXMP5X<unique_ID>",
      schemaList: ["EXAMPLE--Value"],
      areAllSchemasAccessible: false
    };

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