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

    // Create a request and dependent object(s).
    const updatePipelineDetails = {
      displayName: "EXAMPLE-displayName-Value",
      description: "EXAMPLE-description-Value",
      configurationDetails: {
        type: "DEFAULT",
        maximumRuntimeInMinutes: 40390,
        environmentVariables: {
          EXAMPLE_KEY_aIsVE: "EXAMPLE_VALUE_NuKeqDA7vqdMDpTAr9N2"
        },
        commandLineArguments: "EXAMPLE-commandLineArguments-Value"
      },
      infrastructureConfigurationDetails: {
        shapeName: "EXAMPLE-shapeName-Value",
        blockStorageSizeInGBs: 7489,
        subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
        shapeConfigDetails: {
          ocpus: 40.00791,
          memoryInGBs: 83.69849
        }
      },
      logConfigurationDetails: {
        enableLogging: true,
        enableAutoLogCreation: true,
        logGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value",
        logId: "ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value"
      },
      stepDetails: [
        {
          stepType: "CONTAINER",
          stepInfrastructureConfigurationDetails: {
            shapeName: "EXAMPLE-shapeName-Value",
            blockStorageSizeInGBs: 8917,
            subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
            shapeConfigDetails: {
              ocpus: 53.72549,
              memoryInGBs: 67.19739
            }
          },
          stepName: "EXAMPLE-stepName-Value",
          description: "EXAMPLE-description-Value",
          stepConfigurationDetails: {
            maximumRuntimeInMinutes: 39217,
            environmentVariables: {
              EXAMPLE_KEY_GIOyG: "EXAMPLE_VALUE_f6CeUgDl6xVbcWazcJZJ"
            },
            commandLineArguments: "EXAMPLE-commandLineArguments-Value"
          }
        }
      ],
      freeformTags: {
        EXAMPLE_KEY_CLAKA: "EXAMPLE_VALUE_BoBpSL7EuWKywfvCmDCW"
      },
      definedTags: {
        EXAMPLE_KEY_LKu8S: {
          EXAMPLE_KEY_Bo63t: "EXAMPLE--Value"
        }
      }
    };

    const updatePipelineRequest: datascience.requests.UpdatePipelineRequest = {
      pipelineId: "ocid1.test.oc1..<unique_ID>EXAMPLE-pipelineId-Value",
      updatePipelineDetails: updatePipelineDetails,
      ifMatch: "EXAMPLE-ifMatch-Value",
      opcRequestId: "RLOOBOX6XTMC5NTPYUJZ<unique_ID>"
    };

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