# 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).

require 'oci'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
data_integration_client =
  OCI::DataIntegration::DataIntegrationClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
create_data_flow_response =
  data_integration_client.create_data_flow(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value',
    OCI::DataIntegration::Models::CreateDataFlowDetails.new(
      name: 'EXAMPLE-name-Value',
      identifier: 'EXAMPLE-identifier-Value',
      registry_metadata:
        OCI::DataIntegration::Models::RegistryMetadata.new(
          aggregator_key: 'EXAMPLE-aggregatorKey-Value',
          labels: %w[EXAMPLE--Value],
          registry_version: 560,
          key: 'EXAMPLE-key-Value',
          is_favorite: true
        ),
      key: 'EXAMPLE-key-Value',
      model_version: 'EXAMPLE-modelVersion-Value',
      parent_ref:
        OCI::DataIntegration::Models::ParentReference.new(
          parent: 'EXAMPLE-parent-Value',
          root_doc_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
        ),
      nodes: [
        OCI::DataIntegration::Models::FlowNode.new(
          key: 'EXAMPLE-key-Value',
          model_type: 'EXAMPLE-modelType-Value',
          model_version: 'EXAMPLE-modelVersion-Value',
          parent_ref:
            OCI::DataIntegration::Models::ParentReference.new(
              parent: 'EXAMPLE-parent-Value',
              root_doc_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
            ),
          name: 'EXAMPLE-name-Value',
          description: 'EXAMPLE-description-Value',
          input_links: [
            OCI::DataIntegration::Models::InputLink.new(
              model_type: 'INPUT_LINK',
              key: 'EXAMPLE-key-Value',
              model_version: 'EXAMPLE-modelVersion-Value',
              parent_ref:
                OCI::DataIntegration::Models::ParentReference.new(
                  parent: 'EXAMPLE-parent-Value',
                  root_doc_id:
                    'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                ),
              object_status: 239,
              description: 'EXAMPLE-description-Value',
              port: 'EXAMPLE-port-Value',
              from_link: 'EXAMPLE-fromLink-Value',
              field_map:
                OCI::DataIntegration::Models::ConditionalCompositeFieldMap.new(
                  model_type: 'CONDITIONAL_COMPOSITE_FIELD_MAP',
                  description: 'EXAMPLE-description-Value',
                  field_map_scope: [
                    OCI::DataIntegration::Models::NamePatternRule.new(
                      model_type: 'NAME_PATTERN_RULE',
                      key: 'EXAMPLE-key-Value',
                      model_version: 'EXAMPLE-modelVersion-Value',
                      parent_ref:
                        OCI::DataIntegration::Models::ParentReference.new(
                          parent: 'EXAMPLE-parent-Value',
                          root_doc_id:
                            'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                        ),
                      is_java_regex_syntax: true,
                      config_values:
                        OCI::DataIntegration::Models::ConfigValues.new(
                          config_param_values: {
                            'EXAMPLE_KEY_Uf8ce' => {
                              'stringValue' => 'EXAMPLE-stringValue-Value',
                              'intValue' => 166,
                              'objectValue' => 'EXAMPLE-objectValue-Value',
                              'refValue' => 'EXAMPLE-refValue-Value',
                              'parameterValue' =>
                                'EXAMPLE-parameterValue-Value',
                              'rootObjectValue' =>
                                'EXAMPLE-rootObjectValue-Value'
                            }
                          },
                          parent_ref:
                            OCI::DataIntegration::Models::ParentReference.new(
                              parent: 'EXAMPLE-parent-Value',
                              root_doc_id:
                                'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                            )
                        ),
                      object_status: 874,
                      description: 'EXAMPLE-description-Value',
                      is_skip_remaining_rules_on_match: false,
                      scope: 'EXAMPLE-scope-Value',
                      is_cascade: false,
                      matching_strategy: 'NAME_ONLY',
                      is_case_sensitive: false,
                      rule_type: 'EXCLUDE',
                      pattern: 'EXAMPLE-pattern-Value'
                    )
                  ],
                  key: 'EXAMPLE-key-Value',
                  model_version: 'EXAMPLE-modelVersion-Value',
                  parent_ref:
                    OCI::DataIntegration::Models::ParentReference.new(
                      parent: 'EXAMPLE-parent-Value',
                      root_doc_id:
                        'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                    ),
                  config_values:
                    OCI::DataIntegration::Models::ConfigValues.new(
                      config_param_values: {
                        'EXAMPLE_KEY_G3z4c' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 34,
                          'objectValue' => 'EXAMPLE-objectValue-Value',
                          'refValue' => 'EXAMPLE-refValue-Value',
                          'parameterValue' => 'EXAMPLE-parameterValue-Value',
                          'rootObjectValue' => 'EXAMPLE-rootObjectValue-Value'
                        }
                      },
                      parent_ref:
                        OCI::DataIntegration::Models::ParentReference.new(
                          parent: 'EXAMPLE-parent-Value',
                          root_doc_id:
                            'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                        )
                    ),
                  object_status: 262
                )
            )
          ],
          output_links: [
            OCI::DataIntegration::Models::OutputLink.new(
              model_type: 'OUTPUT_LINK',
              key: 'EXAMPLE-key-Value',
              model_version: 'EXAMPLE-modelVersion-Value',
              parent_ref:
                OCI::DataIntegration::Models::ParentReference.new(
                  parent: 'EXAMPLE-parent-Value',
                  root_doc_id:
                    'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                ),
              object_status: 583,
              description: 'EXAMPLE-description-Value',
              port: 'EXAMPLE-port-Value',
              to_links: %w[EXAMPLE--Value]
            )
          ],
          operator:
            OCI::DataIntegration::Models::ExpressionOperator.new(
              model_type: 'EXPRESSION_OPERATOR',
              key: 'EXAMPLE-key-Value',
              model_version: 'EXAMPLE-modelVersion-Value',
              parent_ref:
                OCI::DataIntegration::Models::ParentReference.new(
                  parent: 'EXAMPLE-parent-Value',
                  root_doc_id:
                    'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                ),
              name: 'EXAMPLE-name-Value',
              description: 'EXAMPLE-description-Value',
              object_version: 869,
              input_ports: [
                OCI::DataIntegration::Models::InputPort.new(
                  model_type: 'INPUT_PORT',
                  key: 'EXAMPLE-key-Value',
                  model_version: 'EXAMPLE-modelVersion-Value',
                  parent_ref:
                    OCI::DataIntegration::Models::ParentReference.new(
                      parent: 'EXAMPLE-parent-Value',
                      root_doc_id:
                        'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                    ),
                  config_values:
                    OCI::DataIntegration::Models::ConfigValues.new(
                      config_param_values: {
                        'EXAMPLE_KEY_GmZYg' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 266,
                          'objectValue' => 'EXAMPLE-objectValue-Value',
                          'refValue' => 'EXAMPLE-refValue-Value',
                          'parameterValue' => 'EXAMPLE-parameterValue-Value',
                          'rootObjectValue' => 'EXAMPLE-rootObjectValue-Value'
                        }
                      },
                      parent_ref:
                        OCI::DataIntegration::Models::ParentReference.new(
                          parent: 'EXAMPLE-parent-Value',
                          root_doc_id:
                            'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                        )
                    ),
                  object_status: 144,
                  name: 'EXAMPLE-name-Value',
                  description: 'EXAMPLE-description-Value',
                  port_type: 'MODEL',
                  fields: [
                    OCI::DataIntegration::Models::Parameter.new(
                      model_type: 'PARAMETER',
                      key: 'EXAMPLE-key-Value',
                      model_version: 'EXAMPLE-modelVersion-Value',
                      parent_ref:
                        OCI::DataIntegration::Models::ParentReference.new(
                          parent: 'EXAMPLE-parent-Value',
                          root_doc_id:
                            'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                        ),
                      config_values:
                        OCI::DataIntegration::Models::ConfigValues.new(
                          config_param_values: {
                            'EXAMPLE_KEY_cf9wq' => {
                              'stringValue' => 'EXAMPLE-stringValue-Value',
                              'intValue' => 89,
                              'objectValue' => 'EXAMPLE-objectValue-Value',
                              'refValue' => 'EXAMPLE-refValue-Value',
                              'parameterValue' =>
                                'EXAMPLE-parameterValue-Value',
                              'rootObjectValue' =>
                                'EXAMPLE-rootObjectValue-Value'
                            }
                          },
                          parent_ref:
                            OCI::DataIntegration::Models::ParentReference.new(
                              parent: 'EXAMPLE-parent-Value',
                              root_doc_id:
                                'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                            )
                        ),
                      object_status: 1,
                      name: 'EXAMPLE-name-Value',
                      description: 'EXAMPLE-description-Value',
                      type: 'EXAMPLE-type-Value',
                      default_value: 'EXAMPLE-defaultValue-Value',
                      root_object_default_value:
                        'EXAMPLE-rootObjectDefaultValue-Value',
                      is_input: true,
                      is_output: false,
                      output_aggregation_type: 'MIN',
                      type_name: 'EXAMPLE-typeName-Value',
                      used_for: 'EXAMPLE-usedFor-Value'
                    )
                  ]
                )
              ],
              output_ports: [
                OCI::DataIntegration::Models::OutputField.new(
                  model_type: 'OUTPUT_FIELD',
                  key: 'EXAMPLE-key-Value',
                  model_version: 'EXAMPLE-modelVersion-Value',
                  parent_ref:
                    OCI::DataIntegration::Models::ParentReference.new(
                      parent: 'EXAMPLE-parent-Value',
                      root_doc_id:
                        'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                    ),
                  config_values:
                    OCI::DataIntegration::Models::ConfigValues.new(
                      config_param_values: {
                        'EXAMPLE_KEY_fPFJ8' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 16,
                          'objectValue' => 'EXAMPLE-objectValue-Value',
                          'refValue' => 'EXAMPLE-refValue-Value',
                          'parameterValue' => 'EXAMPLE-parameterValue-Value',
                          'rootObjectValue' => 'EXAMPLE-rootObjectValue-Value'
                        }
                      },
                      parent_ref:
                        OCI::DataIntegration::Models::ParentReference.new(
                          parent: 'EXAMPLE-parent-Value',
                          root_doc_id:
                            'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                        )
                    ),
                  object_status: 692,
                  name: 'EXAMPLE-name-Value',
                  description: 'EXAMPLE-description-Value',
                  type:
                    OCI::DataIntegration::Models::DynamicType.new(
                      model_type: 'DYNAMIC_TYPE',
                      key: 'EXAMPLE-key-Value',
                      model_version: 'EXAMPLE-modelVersion-Value',
                      parent_ref:
                        OCI::DataIntegration::Models::ParentReference.new(
                          parent: 'EXAMPLE-parent-Value',
                          root_doc_id:
                            'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                        ),
                      name: 'EXAMPLE-name-Value',
                      object_status: 904,
                      description: 'EXAMPLE-description-Value',
                      type_handler:
                        OCI::DataIntegration::Models::RuleTypeConfig.new(
                          model_type: 'RULE_TYPE_CONFIGS',
                          key: 'EXAMPLE-key-Value',
                          model_version: 'EXAMPLE-modelVersion-Value',
                          parent_ref:
                            OCI::DataIntegration::Models::ParentReference.new(
                              parent: 'EXAMPLE-parent-Value',
                              root_doc_id:
                                'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                            ),
                          scope: 'EXAMPLE-scope-Value',
                          scope_reference:
                            OCI::DataIntegration::Models::ScopeReference.new(
                              reference_object: 'EXAMPLE-referenceObject-Value',
                              reference_type: 'BOUND_ENTITY_SHAPE_FIELD',
                              ref_object_name: 'EXAMPLE-refObjectName-Value'
                            ),
                          is_order_by_rule: false,
                          projection_rules: [
                            OCI::DataIntegration::Models::RenameRule.new(
                              model_type: 'RENAME_RULE',
                              key: 'EXAMPLE-key-Value',
                              model_version: 'EXAMPLE-modelVersion-Value',
                              parent_ref:
                                OCI::DataIntegration::Models::ParentReference
                                  .new(
                                  parent: 'EXAMPLE-parent-Value',
                                  root_doc_id:
                                    'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                                ),
                              is_java_regex_syntax: false,
                              config_values:
                                OCI::DataIntegration::Models::ConfigValues.new(
                                  config_param_values: {
                                    'EXAMPLE_KEY_9rBaq' => {
                                      'stringValue' =>
                                        'EXAMPLE-stringValue-Value',
                                      'intValue' => 565,
                                      'objectValue' =>
                                        'EXAMPLE-objectValue-Value',
                                      'refValue' => 'EXAMPLE-refValue-Value',
                                      'parameterValue' =>
                                        'EXAMPLE-parameterValue-Value',
                                      'rootObjectValue' =>
                                        'EXAMPLE-rootObjectValue-Value'
                                    }
                                  },
                                  parent_ref:
                                    OCI::DataIntegration::Models::ParentReference
                                      .new(
                                      parent: 'EXAMPLE-parent-Value',
                                      root_doc_id:
                                        'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                                    )
                                ),
                              object_status: 326,
                              description: 'EXAMPLE-description-Value',
                              is_skip_remaining_rules_on_match: false,
                              from_name: 'EXAMPLE-fromName-Value',
                              to_name: 'EXAMPLE-toName-Value'
                            )
                          ],
                          config_values:
                            OCI::DataIntegration::Models::ConfigValues.new(
                              config_param_values: {
                                'EXAMPLE_KEY_VNHkG' => {
                                  'stringValue' => 'EXAMPLE-stringValue-Value',
                                  'intValue' => 807,
                                  'objectValue' => 'EXAMPLE-objectValue-Value',
                                  'refValue' => 'EXAMPLE-refValue-Value',
                                  'parameterValue' =>
                                    'EXAMPLE-parameterValue-Value',
                                  'rootObjectValue' =>
                                    'EXAMPLE-rootObjectValue-Value'
                                }
                              },
                              parent_ref:
                                OCI::DataIntegration::Models::ParentReference
                                  .new(
                                  parent: 'EXAMPLE-parent-Value',
                                  root_doc_id:
                                    'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                                )
                            ),
                          object_status: 190
                        ),
                      config_definition:
                        OCI::DataIntegration::Models::ConfigDefinition.new(
                          key: 'EXAMPLE-key-Value',
                          model_type: 'EXAMPLE-modelType-Value',
                          model_version: 'EXAMPLE-modelVersion-Value',
                          parent_ref:
                            OCI::DataIntegration::Models::ParentReference.new(
                              parent: 'EXAMPLE-parent-Value',
                              root_doc_id:
                                'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                            ),
                          name: 'EXAMPLE-name-Value',
                          is_contained: false,
                          object_status: 89,
                          config_parameter_definitions: {
                            'EXAMPLE_KEY_jULHJ' => {
                              'parameterName' => 'EXAMPLE-parameterName-Value',
                              'description' => 'EXAMPLE-description-Value',
                              'defaultValue' => 'EXAMPLE-defaultValue-Value',
                              'classFieldName' =>
                                'EXAMPLE-classFieldName-Value',
                              'isStatic' => False,
                              'isClassFieldValue' => True
                            }
                          }
                        )
                    ),
                  labels: %w[EXAMPLE--Value]
                )
              ],
              object_status: 785,
              identifier: 'EXAMPLE-identifier-Value',
              parameters: [
                OCI::DataIntegration::Models::Parameter.new(
                  model_type: 'PARAMETER',
                  key: 'EXAMPLE-key-Value',
                  model_version: 'EXAMPLE-modelVersion-Value',
                  parent_ref:
                    OCI::DataIntegration::Models::ParentReference.new(
                      parent: 'EXAMPLE-parent-Value',
                      root_doc_id:
                        'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                    ),
                  config_values:
                    OCI::DataIntegration::Models::ConfigValues.new(
                      config_param_values: {
                        'EXAMPLE_KEY_ruZfH' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 46,
                          'objectValue' => 'EXAMPLE-objectValue-Value',
                          'refValue' => 'EXAMPLE-refValue-Value',
                          'parameterValue' => 'EXAMPLE-parameterValue-Value',
                          'rootObjectValue' => 'EXAMPLE-rootObjectValue-Value'
                        }
                      },
                      parent_ref:
                        OCI::DataIntegration::Models::ParentReference.new(
                          parent: 'EXAMPLE-parent-Value',
                          root_doc_id:
                            'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                        )
                    ),
                  object_status: 757,
                  name: 'EXAMPLE-name-Value',
                  description: 'EXAMPLE-description-Value',
                  type: 'EXAMPLE-type-Value',
                  default_value: 'EXAMPLE-defaultValue-Value',
                  root_object_default_value:
                    'EXAMPLE-rootObjectDefaultValue-Value',
                  is_input: true,
                  is_output: true,
                  output_aggregation_type: 'MAX',
                  type_name: 'EXAMPLE-typeName-Value',
                  used_for: 'EXAMPLE-usedFor-Value'
                )
              ],
              op_config_values:
                OCI::DataIntegration::Models::ConfigValues.new(
                  config_param_values: {
                    'EXAMPLE_KEY_ilctP' => {
                      'stringValue' => 'EXAMPLE-stringValue-Value',
                      'intValue' => 179,
                      'objectValue' => 'EXAMPLE-objectValue-Value',
                      'refValue' => 'EXAMPLE-refValue-Value',
                      'parameterValue' => 'EXAMPLE-parameterValue-Value',
                      'rootObjectValue' => 'EXAMPLE-rootObjectValue-Value'
                    }
                  },
                  parent_ref:
                    OCI::DataIntegration::Models::ParentReference.new(
                      parent: 'EXAMPLE-parent-Value',
                      root_doc_id:
                        'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                    )
                ),
              trigger_rule: 'ALL_FAILED'
            ),
          ui_properties:
            OCI::DataIntegration::Models::UIProperties.new(
              coordinate_x: 5845.516, coordinate_y: 6548.8325
            ),
          object_status: 341
        )
      ],
      parameters: [
        OCI::DataIntegration::Models::Parameter.new(
          model_type: 'PARAMETER',
          key: 'EXAMPLE-key-Value',
          model_version: 'EXAMPLE-modelVersion-Value',
          parent_ref:
            OCI::DataIntegration::Models::ParentReference.new(
              parent: 'EXAMPLE-parent-Value',
              root_doc_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
            ),
          config_values:
            OCI::DataIntegration::Models::ConfigValues.new(
              config_param_values: {
                'EXAMPLE_KEY_izb6A' => {
                  'stringValue' => 'EXAMPLE-stringValue-Value',
                  'intValue' => 579,
                  'objectValue' => 'EXAMPLE-objectValue-Value',
                  'refValue' => 'EXAMPLE-refValue-Value',
                  'parameterValue' => 'EXAMPLE-parameterValue-Value',
                  'rootObjectValue' => 'EXAMPLE-rootObjectValue-Value'
                }
              },
              parent_ref:
                OCI::DataIntegration::Models::ParentReference.new(
                  parent: 'EXAMPLE-parent-Value',
                  root_doc_id:
                    'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
                )
            ),
          object_status: 369,
          name: 'EXAMPLE-name-Value',
          description: 'EXAMPLE-description-Value',
          type: 'EXAMPLE-type-Value',
          default_value: 'EXAMPLE-defaultValue-Value',
          root_object_default_value: 'EXAMPLE-rootObjectDefaultValue-Value',
          is_input: true,
          is_output: false,
          output_aggregation_type: 'SUM',
          type_name: 'EXAMPLE-typeName-Value',
          used_for: 'EXAMPLE-usedFor-Value'
        )
      ],
      description: 'EXAMPLE-description-Value',
      flow_config_values:
        OCI::DataIntegration::Models::ConfigValues.new(
          config_param_values: {
            'EXAMPLE_KEY_mHMbu' => {
              'stringValue' => 'EXAMPLE-stringValue-Value',
              'intValue' => 119,
              'objectValue' => 'EXAMPLE-objectValue-Value',
              'refValue' => 'EXAMPLE-refValue-Value',
              'parameterValue' => 'EXAMPLE-parameterValue-Value',
              'rootObjectValue' => 'EXAMPLE-rootObjectValue-Value'
            }
          },
          parent_ref:
            OCI::DataIntegration::Models::ParentReference.new(
              parent: 'EXAMPLE-parent-Value',
              root_doc_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'
            )
        ),
      object_status: 399
    )
  )

# Get the data from response
puts "#{create_data_flow_response.data}"