// 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 updateDataFlowDetails = {
      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",
      identifier: "EXAMPLE-identifier-Value",
      objectVersion: 645,
      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_kXj2k: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 941,
                      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: 573,
                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: 943,
              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: 442,
              description: "EXAMPLE-description-Value",
              port: "EXAMPLE-port-Value"
            }
          ],
          operator: {
            modelType: "SORT_OPERATOR",
            sortKey: {
              sortRules: [
                {
                  wrappedRule: {
                    modelType: "TYPE_LIST_RULE",
                    isSkipRemainingRulesOnMatch: true,
                    scope: "EXAMPLE-scope-Value",
                    isCascade: false,
                    matchingStrategy: dataintegration.models.TypeListRule.MatchingStrategy.TagsOnly,
                    isCaseSensitive: false,
                    ruleType: dataintegration.models.TypeListRule.RuleType.Include,
                    types: ["EXAMPLE-types-Value"],
                    key: "EXAMPLE-key-Value",
                    modelVersion: "EXAMPLE-modelVersion-Value",
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    },
                    isJavaRegexSyntax: false,
                    configValues: {
                      configParamValues: {
                        EXAMPLE_KEY_Y6mC3: {
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 265,
                          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: 556,
                    description: "EXAMPLE-description-Value"
                  },
                  isAscending: 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: 917,
            inputPorts: [
              {
                modelType: "INPUT_PORT",
                portType: dataintegration.models.InputPort.PortType.Control,
                fields: [
                  {
                    modelType: "INPUT_PROXY_FIELD",
                    scope: "EXAMPLE-scope-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: true,
                        objectStatus: 506,
                        configParameterDefinitions: {
                          EXAMPLE_KEY_io3Qv: {
                            parameterName: "EXAMPLE-parameterName-Value",
                            description: "EXAMPLE-description-Value",
                            defaultValue: "EXAMPLE-defaultValue-Value",
                            classFieldName: "EXAMPLE-classFieldName-Value",
                            isStatic: false,
                            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: 534,
                      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_8QSxR: {
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 705,
                          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: 220,
                    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_Mbg6p: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 905,
                      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: 870,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            outputPorts: [
              {
                modelType: "MATERIALIZED_DYNAMIC_FIELD",
                scope: "EXAMPLE-scope-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: 309,
                    configParameterDefinitions: {
                      EXAMPLE_KEY_LhgdY: {
                        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: 723,
                  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_qC1UQ: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 623,
                      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: 366,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            objectStatus: 797,
            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.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_kqoF8: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 599,
                      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: 262,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            ],
            opConfigValues: {
              configParamValues: {
                EXAMPLE_KEY_ZbiQo: {
                  stringValue: "EXAMPLE-stringValue-Value",
                  intValue: 940,
                  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: 3522.7769,
            coordinateY: 2468.086
          },
          objectStatus: 145
        }
      ],
      parameters: [
        {
          modelType: "PARAMETER",
          type: "EXAMPLE-type-Value",
          defaultValue: "EXAMPLE-defaultValue-Value",
          rootObjectDefaultValue: "EXAMPLE-rootObjectDefaultValue-Value",
          isInput: true,
          isOutput: true,
          outputAggregationType: dataintegration.models.Parameter.OutputAggregationType.Sum,
          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_GS52o: {
                stringValue: "EXAMPLE-stringValue-Value",
                intValue: 435,
                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: 826,
          name: "EXAMPLE-name-Value",
          description: "EXAMPLE-description-Value"
        }
      ],
      description: "EXAMPLE-description-Value",
      flowConfigValues: {
        configParamValues: {
          EXAMPLE_KEY_DYJab: {
            stringValue: "EXAMPLE-stringValue-Value",
            intValue: 698,
            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: 419,
      registryMetadata: {
        aggregatorKey: "EXAMPLE-aggregatorKey-Value",
        labels: ["EXAMPLE--Value"],
        registryVersion: 242,
        key: "EXAMPLE-key-Value",
        isFavorite: true
      }
    };

    const updateDataFlowRequest: dataintegration.requests.UpdateDataFlowRequest = {
      workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
      dataFlowKey: "EXAMPLE-dataFlowKey-Value",
      updateDataFlowDetails: updateDataFlowDetails,
      opcRequestId: "SE59BY8RVWRJTASO1MFB<unique_ID>",
      ifMatch: "EXAMPLE-ifMatch-Value"
    };

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