# 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
update_task_response =
  data_integration_client.update_task(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value',
    'EXAMPLE-taskKey-Value',
    OCI::DataIntegration::Models::UpdateTaskFromSQLTask.new(
      model_type: 'SQL_TASK',
      key: 'EXAMPLE-key-Value',
      object_version: 179,
      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_status: 567,
      identifier: 'EXAMPLE-identifier-Value',
      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_0xNri' => {
                  '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: 596,
          name: 'EXAMPLE-name-Value',
          description: 'EXAMPLE-description-Value',
          port_type: 'CONTROL',
          fields: [
            OCI::DataIntegration::Models::DynamicInputField.new(
              model_type: 'DYNAMIC_INPUT_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_fHEed' => {
                      'stringValue' => 'EXAMPLE-stringValue-Value',
                      'intValue' => 800,
                      '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: 415,
              name: 'EXAMPLE-name-Value',
              description: 'EXAMPLE-description-Value',
              type:
                OCI::DataIntegration::Models::CompositeType.new(
                  model_type: 'COMPOSITE_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: 158,
                  description: 'EXAMPLE-description-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: false,
                      object_status: 95,
                      config_parameter_definitions: {
                        'EXAMPLE_KEY_Wx2lY' => {
                          'parameterName' => 'EXAMPLE-parameterName-Value',
                          'description' => 'EXAMPLE-description-Value',
                          'defaultValue' => 'EXAMPLE-defaultValue-Value',
                          'classFieldName' => 'EXAMPLE-classFieldName-Value',
                          'isStatic' => False,
                          'isClassFieldValue' => True
                        }
                      }
                    )
                ),
              labels: %w[EXAMPLE--Value]
            )
          ]
        )
      ],
      output_ports: [
        OCI::DataIntegration::Models::OutputPort.new(
          model_type: 'OUTPUT_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_48aaZ' => {
                  'stringValue' => 'EXAMPLE-stringValue-Value',
                  'intValue' => 633,
                  '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: 285,
          name: 'EXAMPLE-name-Value',
          description: 'EXAMPLE-description-Value',
          port_type: 'MODEL',
          fields: [
            OCI::DataIntegration::Models::TypedExpression.new(
              model_type: 'TYPED_EXPRESSION',
              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_2LDl3' => {
                      'stringValue' => 'EXAMPLE-stringValue-Value',
                      'intValue' => 830,
                      '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: 918,
              name: 'EXAMPLE-name-Value',
              description: 'EXAMPLE-description-Value',
              expression: 'EXAMPLE-expression-Value',
              type: 'EXAMPLE-type-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_uNHrc' => {
                  'stringValue' => 'EXAMPLE-stringValue-Value',
                  'intValue' => 307,
                  '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: 354,
          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: false,
          is_output: true,
          output_aggregation_type: 'COUNT',
          type_name: 'EXAMPLE-typeName-Value',
          used_for: 'EXAMPLE-usedFor-Value'
        )
      ],
      op_config_values:
        OCI::DataIntegration::Models::ConfigValues.new(
          config_param_values: {
            'EXAMPLE_KEY_HhuVS' => {
              'stringValue' => 'EXAMPLE-stringValue-Value',
              'intValue' => 223,
              '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'
            )
        ),
      is_concurrent_allowed: true,
      registry_metadata:
        OCI::DataIntegration::Models::RegistryMetadata.new(
          aggregator_key: 'EXAMPLE-aggregatorKey-Value',
          labels: %w[EXAMPLE--Value],
          registry_version: 603,
          key: 'EXAMPLE-key-Value',
          is_favorite: true
        ),
      script:
        OCI::DataIntegration::Models::Script.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'
            ),
          object_status: 896
        ),
      sql_script_type: 'SQL_CODE',
      operation: 'EXAMPLE-operation-Value'
    )
  )

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

Was this article helpful?