// 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 createPipelineDetails = {
      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: 258,
      objectStatus: 540,
      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: "COMPOSITE_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_GEOBb: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 248,
                      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: 981,
                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: 539,
              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: 353,
              description: "EXAMPLE-description-Value",
              port: "EXAMPLE-port-Value"
            }
          ],
          operator: {
            modelType: "START_OPERATOR",
            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: 25,
            inputPorts: [
              {
                modelType: "INPUT_PORT",
                portType: dataintegration.models.InputPort.PortType.Control,
                fields: [
                  {
                    modelType: "PROXY_FIELD",
                    scope: "EXAMPLE-scope-Value",
                    scopeReference: {
                      referenceObject: "EXAMPLE-referenceObject-Value",
                      referenceType:
                        dataintegration.models.ScopeReference.ReferenceType.OciFunctionOutputShape,
                      refObjectName: "EXAMPLE-refObjectName-Value"
                    },
                    type: {
                      modelType: "CONFIGURED_TYPE",
                      wrappedType: "EXAMPLE-wrappedType-Value",
                      configValues: {
                        configParamValues: {
                          EXAMPLE_KEY_62WJZ: {
                            stringValue: "EXAMPLE-stringValue-Value",
                            intValue: 2,
                            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"
                        }
                      },
                      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: 124,
                        configParameterDefinitions: {
                          EXAMPLE_KEY_cML9I: {
                            parameterName: "EXAMPLE-parameterName-Value",
                            description: "EXAMPLE-description-Value",
                            defaultValue: "EXAMPLE-defaultValue-Value",
                            classFieldName: "EXAMPLE-classFieldName-Value",
                            isStatic: true,
                            isClassFieldValue: 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",
                      objectStatus: 676,
                      description: "EXAMPLE-description-Value"
                    },
                    labels: ["EXAMPLE--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_5OTPQ: {
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 801,
                          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: 746,
                    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_ZFRut: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 338,
                      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: 515,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            outputPorts: [
              {
                modelType: "TYPED_EXPRESSION",
                expression: "EXAMPLE-expression-Value",
                type: "EXAMPLE-type-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_1CmF6: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 913,
                      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: 804,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            objectStatus: 175,
            identifier: "EXAMPLE-identifier-Value",
            parameters: [
              {
                modelType: "PARAMETER",
                type: "EXAMPLE-type-Value",
                defaultValue: "EXAMPLE-defaultValue-Value",
                rootObjectDefaultValue: "EXAMPLE-rootObjectDefaultValue-Value",
                isInput: true,
                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_2jmOj: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 898,
                      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: 702,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            opConfigValues: {
              configParamValues: {
                EXAMPLE_KEY_0ZXJE: {
                  stringValue: "EXAMPLE-stringValue-Value",
                  intValue: 263,
                  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: 2364.8965,
            coordinateY: 2856.9167
          },
          objectStatus: 62
        }
      ],
      parameters: [
        {
          modelType: "PARAMETER",
          type: "EXAMPLE-type-Value",
          defaultValue: "EXAMPLE-defaultValue-Value",
          rootObjectDefaultValue: "EXAMPLE-rootObjectDefaultValue-Value",
          isInput: true,
          isOutput: false,
          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_aG8m3: {
                stringValue: "EXAMPLE-stringValue-Value",
                intValue: 284,
                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: 794,
          name: "EXAMPLE-name-Value",
          description: "EXAMPLE-description-Value"
        }
      ],
      flowConfigValues: {
        configParamValues: {
          EXAMPLE_KEY_CNJOR: {
            stringValue: "EXAMPLE-stringValue-Value",
            intValue: 818,
            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: 38,
          objectStatus: 598,
          identifier: "EXAMPLE-identifier-Value",
          type: {
            modelType: "JAVA_TYPE",
            javaTypeName: "EXAMPLE-javaTypeName-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: false,
              objectStatus: 235,
              configParameterDefinitions: {
                EXAMPLE_KEY_d44V8: {
                  parameterName: "EXAMPLE-parameterName-Value",
                  description: "EXAMPLE-description-Value",
                  defaultValue: "EXAMPLE-defaultValue-Value",
                  classFieldName: "EXAMPLE-classFieldName-Value",
                  isStatic: true,
                  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: 739,
            description: "EXAMPLE-description-Value"
          },
          configValues: {
            configParamValues: {
              EXAMPLE_KEY_5WvBp: {
                stringValue: "EXAMPLE-stringValue-Value",
                intValue: 84,
                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: 466
          }
        }
      ],
      registryMetadata: {
        aggregatorKey: "EXAMPLE-aggregatorKey-Value",
        labels: ["EXAMPLE--Value"],
        registryVersion: 220,
        key: "EXAMPLE-key-Value",
        isFavorite: true
      }
    };

    const createPipelineRequest: dataintegration.requests.CreatePipelineRequest = {
      workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
      createPipelineDetails: createPipelineDetails,
      opcRetryToken: "EXAMPLE-opcRetryToken-Value",
      opcRequestId: "K52HAYPVJXMMFUKLY0AJ<unique_ID>"
    };

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