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

    // Create a request and dependent object(s).
    const createPipelineValidationDetails = {
      key: "EXAMPLE-key-Value",
      modelVersion: "EXAMPLE-modelVersion-Value",
      parentRef: {
        parent: "EXAMPLE-parent-Value",
        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
      },
      name: "EXAMPLE-name-Value",
      description: "EXAMPLE-description-Value",
      modelType: "EXAMPLE-modelType-Value",
      objectVersion: 347,
      objectStatus: 486,
      identifier: "EXAMPLE-identifier-Value",
      nodes: [
        {
          key: "EXAMPLE-key-Value",
          modelType: "EXAMPLE-modelType-Value",
          modelVersion: "EXAMPLE-modelVersion-Value",
          parentRef: {
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          },
          name: "EXAMPLE-name-Value",
          description: "EXAMPLE-description-Value",
          inputLinks: [
            {
              modelType: "INPUT_LINK",
              fromLink: "EXAMPLE-fromLink-Value",
              fieldMap: {
                modelType: "DIRECT_FIELD_MAP",
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_MtzGZ: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 465,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                sourceTypedObject: "EXAMPLE-sourceTypedObject-Value",
                targetTypedObject: "EXAMPLE-targetTypedObject-Value",
                sourceScopeReference: {
                  referenceObject: "EXAMPLE-referenceObject-Value",
                  referenceType:
                    dataintegration.models.ScopeReference.ReferenceType.BoundEntityShape,
                  refObjectName: "EXAMPLE-refObjectName-Value"
                },
                targetScopeReference: {
                  referenceObject: "EXAMPLE-referenceObject-Value",
                  referenceType:
                    dataintegration.models.ScopeReference.ReferenceType.BoundEntityShapeField,
                  refObjectName: "EXAMPLE-refObjectName-Value"
                },
                objectStatus: 681,
                description: "EXAMPLE-description-Value"
              },
              key: "EXAMPLE-key-Value",
              modelVersion: "EXAMPLE-modelVersion-Value",
              parentRef: {
                parent: "EXAMPLE-parent-Value",
                rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
              },
              objectStatus: 691,
              description: "EXAMPLE-description-Value",
              port: "EXAMPLE-port-Value"
            }
          ],
          outputLinks: [
            {
              modelType: "OUTPUT_LINK",
              toLinks: ["EXAMPLE--Value"],
              key: "EXAMPLE-key-Value",
              modelVersion: "EXAMPLE-modelVersion-Value",
              parentRef: {
                parent: "EXAMPLE-parent-Value",
                rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
              },
              objectStatus: 218,
              description: "EXAMPLE-description-Value",
              port: "EXAMPLE-port-Value"
            }
          ],
          operator: {
            modelType: "INTERSECT_OPERATOR",
            intersectType: dataintegration.models.Intersect.IntersectType.Position,
            isAll: false,
            key: "EXAMPLE-key-Value",
            modelVersion: "EXAMPLE-modelVersion-Value",
            parentRef: {
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            },
            name: "EXAMPLE-name-Value",
            description: "EXAMPLE-description-Value",
            objectVersion: 235,
            inputPorts: [
              {
                modelType: "INPUT_PORT",
                portType: dataintegration.models.InputPort.PortType.Model,
                fields: [
                  {
                    modelType: "OUTPUT_PORT",
                    portType: dataintegration.models.OutputPort.PortType.Control,
                    key: "EXAMPLE-key-Value",
                    modelVersion: "EXAMPLE-modelVersion-Value",
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    },
                    configValues: {
                      configParamValues: {
                        EXAMPLE_KEY_fDLgK: {
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 569,
                          objectValue: "EXAMPLE-objectValue-Value",
                          refValue: "EXAMPLE-refValue-Value",
                          parameterValue: "EXAMPLE-parameterValue-Value",
                          rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                        }
                      },
                      parentRef: {
                        parent: "EXAMPLE-parent-Value",
                        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                      }
                    },
                    objectStatus: 861,
                    name: "EXAMPLE-name-Value",
                    description: "EXAMPLE-description-Value"
                  }
                ],
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_C8MUH: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 271,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                objectStatus: 690,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            outputPorts: [
              {
                modelType: "SHAPE",
                type: {
                  modelType: "ARRAY_TYPE",
                  elementType: "EXAMPLE-elementType-Value",
                  key: "EXAMPLE-key-Value",
                  modelVersion: "EXAMPLE-modelVersion-Value",
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  },
                  name: "EXAMPLE-name-Value",
                  objectStatus: 151,
                  description: "EXAMPLE-description-Value"
                },
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_FSREm: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 688,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                objectStatus: 149,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            objectStatus: 430,
            identifier: "EXAMPLE-identifier-Value",
            parameters: [
              {
                modelType: "PARAMETER",
                type: "EXAMPLE-type-Value",
                defaultValue: "EXAMPLE-defaultValue-Value",
                rootObjectDefaultValue: "EXAMPLE-rootObjectDefaultValue-Value",
                isInput: false,
                isOutput: true,
                outputAggregationType: dataintegration.models.Parameter.OutputAggregationType.Min,
                typeName: "EXAMPLE-typeName-Value",
                usedFor: "EXAMPLE-usedFor-Value",
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_jmE8O: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 117,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                objectStatus: 436,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            opConfigValues: {
              configParamValues: {
                EXAMPLE_KEY_E9HAD: {
                  stringValue: "EXAMPLE-stringValue-Value",
                  intValue: 488,
                  objectValue: "EXAMPLE-objectValue-Value",
                  refValue: "EXAMPLE-refValue-Value",
                  parameterValue: "EXAMPLE-parameterValue-Value",
                  rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                }
              },
              parentRef: {
                parent: "EXAMPLE-parent-Value",
                rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
              }
            }
          },
          uiProperties: {
            coordinateX: 1449.3114,
            coordinateY: 469.5052
          },
          objectStatus: 689
        }
      ],
      parameters: [
        {
          modelType: "PARAMETER",
          type: "EXAMPLE-type-Value",
          defaultValue: "EXAMPLE-defaultValue-Value",
          rootObjectDefaultValue: "EXAMPLE-rootObjectDefaultValue-Value",
          isInput: false,
          isOutput: false,
          outputAggregationType: dataintegration.models.Parameter.OutputAggregationType.Count,
          typeName: "EXAMPLE-typeName-Value",
          usedFor: "EXAMPLE-usedFor-Value",
          key: "EXAMPLE-key-Value",
          modelVersion: "EXAMPLE-modelVersion-Value",
          parentRef: {
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          },
          configValues: {
            configParamValues: {
              EXAMPLE_KEY_ScRPY: {
                stringValue: "EXAMPLE-stringValue-Value",
                intValue: 107,
                objectValue: "EXAMPLE-objectValue-Value",
                refValue: "EXAMPLE-refValue-Value",
                parameterValue: "EXAMPLE-parameterValue-Value",
                rootObjectValue: "EXAMPLE-rootObjectValue-Value"
              }
            },
            parentRef: {
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            }
          },
          objectStatus: 970,
          name: "EXAMPLE-name-Value",
          description: "EXAMPLE-description-Value"
        }
      ],
      flowConfigValues: {
        configParamValues: {
          EXAMPLE_KEY_gmhbz: {
            stringValue: "EXAMPLE-stringValue-Value",
            intValue: 303,
            objectValue: "EXAMPLE-objectValue-Value",
            refValue: "EXAMPLE-refValue-Value",
            parameterValue: "EXAMPLE-parameterValue-Value",
            rootObjectValue: "EXAMPLE-rootObjectValue-Value"
          }
        },
        parentRef: {
          parent: "EXAMPLE-parent-Value",
          rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
        }
      },
      variables: [
        {
          key: "EXAMPLE-key-Value",
          modelVersion: "EXAMPLE-modelVersion-Value",
          modelType: "EXAMPLE-modelType-Value",
          parentRef: {
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          },
          name: "EXAMPLE-name-Value",
          description: "EXAMPLE-description-Value",
          objectVersion: 937,
          objectStatus: 932,
          identifier: "EXAMPLE-identifier-Value",
          type: {
            modelType: "MATERIALIZED_COMPOSITE_TYPE",
            elements: ["EXAMPLE--Value"],
            pathNames: ["EXAMPLE--Value"],
            configDefinition: {
              key: "EXAMPLE-key-Value",
              modelType: "EXAMPLE-modelType-Value",
              modelVersion: "EXAMPLE-modelVersion-Value",
              parentRef: {
                parent: "EXAMPLE-parent-Value",
                rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
              },
              name: "EXAMPLE-name-Value",
              isContained: true,
              objectStatus: 765,
              configParameterDefinitions: {
                EXAMPLE_KEY_65XFq: {
                  parameterName: "EXAMPLE-parameterName-Value",
                  description: "EXAMPLE-description-Value",
                  defaultValue: "EXAMPLE-defaultValue-Value",
                  classFieldName: "EXAMPLE-classFieldName-Value",
                  isStatic: false,
                  isClassFieldValue: true
                }
              }
            },
            key: "EXAMPLE-key-Value",
            modelVersion: "EXAMPLE-modelVersion-Value",
            parentRef: {
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            },
            name: "EXAMPLE-name-Value",
            objectStatus: 148,
            description: "EXAMPLE-description-Value"
          },
          configValues: {
            configParamValues: {
              EXAMPLE_KEY_x4rDp: {
                stringValue: "EXAMPLE-stringValue-Value",
                intValue: 317,
                objectValue: "EXAMPLE-objectValue-Value",
                refValue: "EXAMPLE-refValue-Value",
                parameterValue: "EXAMPLE-parameterValue-Value",
                rootObjectValue: "EXAMPLE-rootObjectValue-Value"
              }
            },
            parentRef: {
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            }
          },
          defaultValue: "EXAMPLE-defaultValue-Value",
          rootObjectDefaultValue: {
            key: "EXAMPLE-key-Value",
            modelType: "EXAMPLE-modelType-Value",
            modelVersion: "EXAMPLE-modelVersion-Value",
            parentRef: {
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            },
            objectStatus: 734
          }
        }
      ],
      metadata: {
        createdBy: "EXAMPLE-createdBy-Value",
        createdByName: "EXAMPLE-createdByName-Value",
        updatedBy: "EXAMPLE-updatedBy-Value",
        updatedByName: "EXAMPLE-updatedByName-Value",
        timeCreated: new Date("Sun Apr 07 04:57:37 UTC 2030"),
        timeUpdated: new Date("Mon Sep 10 19:38:22 UTC 2007"),
        aggregatorKey: "EXAMPLE-aggregatorKey-Value",
        aggregator: {
          type: "EXAMPLE-type-Value",
          key: "EXAMPLE-key-Value",
          name: "EXAMPLE-name-Value",
          identifier: "EXAMPLE-identifier-Value",
          description: "EXAMPLE-description-Value"
        },
        identifierPath: "EXAMPLE-identifierPath-Value",
        infoFields: {
          EXAMPLE_KEY_GZFfM: "EXAMPLE_VALUE_Ib2dEseapLLucEut06eQ"
        },
        registryVersion: 723,
        labels: ["EXAMPLE--Value"],
        isFavorite: true,
        countStatistics: {
          objectTypeCountList: [
            {
              objectType: dataintegration.models.CountStatisticSummary.ObjectType.FunctionLibrary,
              objectCount: 881
            }
          ]
        }
      }
    };

    const createPipelineValidationRequest: dataintegration.requests.CreatePipelineValidationRequest = {
      workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
      createPipelineValidationDetails: createPipelineValidationDetails,
      opcRequestId: "S7L00I7JA5SI9EFTC1WO<unique_ID>",
      opcRetryToken: "EXAMPLE-opcRetryToken-Value"
    };

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