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

    // Create a request and dependent object(s).
    const createTranscriptionJobDetails = {
      displayName: "EXAMPLE-displayName-Value",
      compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
      description: "EXAMPLE-description-Value",
      additionalTranscriptionFormats: [
        aispeech.models.CreateTranscriptionJobDetails.AdditionalTranscriptionFormats.Srt
      ],
      modelDetails: {
        modelType: "EXAMPLE-modelType-Value",
        domain: aispeech.models.TranscriptionModelDetails.Domain.Generic,
        languageCode: aispeech.models.TranscriptionModelDetails.LanguageCode.Da,
        transcriptionSettings: {
          diarization: {
            isDiarizationEnabled: true,
            numberOfSpeakers: 12
          }
        }
      },
      normalization: {
        isPunctuationEnabled: true,
        filters: [
          {
            type: "PROFANITY",
            mode: aispeech.models.ProfanityTranscriptionFilter.Mode.Tag
          }
        ]
      },
      inputLocation: {
        locationType: "OBJECT_LIST_FILE_INPUT_LOCATION",
        objectLocation: {
          namespaceName: "EXAMPLE-namespaceName-Value",
          bucketName: "EXAMPLE-bucketName-Value",
          objectNames: ["EXAMPLE--Value"]
        }
      },
      outputLocation: {
        namespaceName: "EXAMPLE-namespaceName-Value",
        bucketName: "EXAMPLE-bucketName-Value",
        prefix: "EXAMPLE-prefix-Value"
      },
      freeformTags: {
        EXAMPLE_KEY_m3awa: "EXAMPLE_VALUE_cc9Y0ObOOrKN8BvGv7go"
      },
      definedTags: {
        EXAMPLE_KEY_JRJgF: {
          EXAMPLE_KEY_Ntmh6: "EXAMPLE--Value"
        }
      }
    };

    const createTranscriptionJobRequest: aispeech.requests.CreateTranscriptionJobRequest = {
      createTranscriptionJobDetails: createTranscriptionJobDetails,
      opcRetryToken: "EXAMPLE-opcRetryToken-Value",
      opcRequestId: "UJQ8UYRY04DYPWG0AMAA<unique_ID>"
    };

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