# 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: 319,
          key: 'EXAMPLE-key-Value',
          is_favorite: false
        ),
      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: 21,
              description: 'EXAMPLE-description-Value',
              port: 'EXAMPLE-port-Value',
              from_link: 'EXAMPLE-fromLink-Value',
              field_map:
                OCI::DataIntegration::Models::DirectNamedFieldMap.new(
                  model_type: 'DIRECT_NAMED_FIELD_MAP',
                  description: 'EXAMPLE-description-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_aNJ4q' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 247,
                          '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'
                        )
                    ),
                  source_typed_object: 'EXAMPLE-sourceTypedObject-Value',
                  target_typed_object: 'EXAMPLE-targetTypedObject-Value',
                  source_scope_reference:
                    OCI::DataIntegration::Models::ScopeReference.new(
                      reference_object: 'EXAMPLE-referenceObject-Value',
                      reference_type: 'DIRECT_REF',
                      ref_object_name: 'EXAMPLE-refObjectName-Value'
                    ),
                  target_scope_reference:
                    OCI::DataIntegration::Models::ScopeReference.new(
                      reference_object: 'EXAMPLE-referenceObject-Value',
                      reference_type: 'OCI_FUNCTION_INPUT_SHAPE',
                      ref_object_name: 'EXAMPLE-refObjectName-Value'
                    ),
                  source_field_name: 'EXAMPLE-sourceFieldName-Value',
                  target_field_name: 'EXAMPLE-targetFieldName-Value',
                  object_status: 992
                )
            )
          ],
          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: 177,
              description: 'EXAMPLE-description-Value',
              port: 'EXAMPLE-port-Value',
              to_links: %w[EXAMPLE--Value]
            )
          ],
          operator:
            OCI::DataIntegration::Models::Split.new(
              model_type: 'SPLIT_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: 922,
              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_Fplz6' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 194,
                          '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: 329,
                  name: 'EXAMPLE-name-Value',
                  description: 'EXAMPLE-description-Value',
                  port_type: 'MODEL',
                  fields: [
                    OCI::DataIntegration::Models::InputProxyField.new(
                      model_type: 'INPUT_PROXY_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_Elh4K' => {
                              'stringValue' => 'EXAMPLE-stringValue-Value',
                              'intValue' => 113,
                              '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: 971,
                      name: 'EXAMPLE-name-Value',
                      description: 'EXAMPLE-description-Value',
                      scope: 'EXAMPLE-scope-Value',
                      type:
                        OCI::DataIntegration::Models::ArrayType.new(
                          model_type: 'ARRAY_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: 933,
                          description: 'EXAMPLE-description-Value',
                          element_type: 'EXAMPLE-elementType-Value'
                        ),
                      labels: %w[EXAMPLE--Value]
                    )
                  ]
                )
              ],
              output_ports: [
                OCI::DataIntegration::Models::MacroField.new(
                  model_type: 'MACRO_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_qny56' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 860,
                          '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: 703,
                  name: 'EXAMPLE-name-Value',
                  description: 'EXAMPLE-description-Value',
                  expr:
                    OCI::DataIntegration::Models::Expression.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'
                        ),
                      expr_string: 'EXAMPLE-exprString-Value',
                      config_values:
                        OCI::DataIntegration::Models::ConfigValues.new(
                          config_param_values: {
                            'EXAMPLE_KEY_YikuY' => {
                              'stringValue' => 'EXAMPLE-stringValue-Value',
                              'intValue' => 585,
                              '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: 497
                    ),
                  type:
                    OCI::DataIntegration::Models::ArrayType.new(
                      model_type: 'ARRAY_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: 106,
                      description: 'EXAMPLE-description-Value',
                      element_type: 'EXAMPLE-elementType-Value'
                    ),
                  is_use_source_type: true,
                  use_type:
                    OCI::DataIntegration::Models::ConfiguredType.new(
                      model_type: 'CONFIGURED_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: 955,
                      description: 'EXAMPLE-description-Value',
                      wrapped_type: 'EXAMPLE-wrappedType-Value',
                      config_values:
                        OCI::DataIntegration::Models::ConfigValues.new(
                          config_param_values: {
                            'EXAMPLE_KEY_KT8Mi' => {
                              'stringValue' => 'EXAMPLE-stringValue-Value',
                              'intValue' => 265,
                              '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'
                            )
                        ),
                      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: true,
                          object_status: 974,
                          config_parameter_definitions: {
                            'EXAMPLE_KEY_mzWL4' => {
                              'parameterType' => {
                                'modelType' => 'JAVA_TYPE',
                                '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' => 274,
                                'description' => 'EXAMPLE-description-Value',
                                'javaTypeName' => 'EXAMPLE-javaTypeName-Value'
                              },
                              'parameterName' => 'EXAMPLE-parameterName-Value',
                              'description' => 'EXAMPLE-description-Value',
                              'defaultValue' => 'EXAMPLE-defaultValue-Value',
                              'classFieldName' =>
                                'EXAMPLE-classFieldName-Value',
                              'isStatic' => True,
                              'isClassFieldValue' => False
                            }
                          }
                        )
                    ),
                  labels: %w[EXAMPLE--Value]
                )
              ],
              object_status: 145,
              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_VWco1' => {
                          'stringValue' => 'EXAMPLE-stringValue-Value',
                          'intValue' => 207,
                          '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: 177,
                  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'
                )
              ],
              op_config_values:
                OCI::DataIntegration::Models::ConfigValues.new(
                  config_param_values: {
                    'EXAMPLE_KEY_58oo3' => {
                      'stringValue' => 'EXAMPLE-stringValue-Value',
                      'intValue' => 840,
                      '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'
                    )
                ),
              data_routing_strategy: 'FIRST'
            ),
          ui_properties:
            OCI::DataIntegration::Models::UIProperties.new(
              coordinate_x: 9650.419, coordinate_y: 7837.3306
            ),
          object_status: 592
        )
      ],
      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_mFInd' => {
                  'stringValue' => 'EXAMPLE-stringValue-Value',
                  'intValue' => 858,
                  '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: 616,
          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: 'COUNT',
          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_MA4U8' => {
              'stringValue' => 'EXAMPLE-stringValue-Value',
              'intValue' => 531,
              '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: 127
    )
  )

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