// 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).
package main
import (
"context"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/dataintegration"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleCreateTask() {
// 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.
client, err := dataintegration.NewDataIntegrationClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
var objectValue interface{}
objectValue = "EXAMPLE-objectValue-Value"
var refValue interface{}
refValue = "EXAMPLE-refValue-Value"
var rootObjectValue interface{}
rootObjectValue = "EXAMPLE-rootObjectValue-Value"
var simpleValue interface{}
simpleValue = "EXAMPLE-simpleValue-Value"
var wrappedType interface{}
wrappedType = "EXAMPLE-wrappedType-Value"
var defaultValue interface{}
defaultValue = "EXAMPLE-defaultValue-Value"
var rootObjectDefaultValue interface{}
rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
var type_ interface{}
type_ = "EXAMPLE-type-Value"
req := dataintegration.CreateTaskRequest{CreateTaskDetails: dataintegration.CreateTaskFromOciDataflowTask{DriverShapeDetails: &dataintegration.ShapeDetails{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_9a5IK": dataintegration.ConfigParameterValue{IntValue: common.Int(341),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}},
ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")}}},
OutputPorts: []dataintegration.OutputPort{dataintegration.OutputPort{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_joEbN": dataintegration.ConfigParameterValue{IntValue: common.Int(73),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
Fields: []dataintegration.TypedObject{dataintegration.DerivedField{Type: common.String("EXAMPLE-type-Value"),
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_EEwCi": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(284),
ObjectValue: &objectValue}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
Description: common.String("EXAMPLE-description-Value"),
IsUseInferredType: common.Bool(false),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Expr: &dataintegration.Expression{ObjectStatus: common.Int(205),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_iao5J": dataintegration.ConfigParameterValue{IntValue: common.Int(499),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
ExprString: common.String("EXAMPLE-exprString-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value")},
Labels: []string{"EXAMPLE--Value"},
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(906),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(975),
Description: common.String("EXAMPLE-description-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
PortType: dataintegration.OutputPortPortTypeData}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
Description: common.String("EXAMPLE-description-Value"),
IsConcurrentAllowed: common.Bool(false),
ObjectStatus: common.Int(235),
ConfigProviderDelegate: &dataintegration.CreateConfigProvider{Bindings: map[string]dataintegration.ParameterValue{"EXAMPLE_KEY_xZORi": dataintegration.ParameterValue{RootObjectValue: &rootObjectValue,
SimpleValue: &simpleValue}}},
DataflowApplication: &dataintegration.DataflowApplication{ApplicationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value"),
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_NvypK": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(225),
ObjectValue: &objectValue}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_jyzB8": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(989),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
RegistryMetadata: &dataintegration.RegistryMetadata{AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
IsFavorite: common.Bool(true),
Key: common.String("EXAMPLE-key-Value"),
Labels: []string{"EXAMPLE--Value"},
RegistryVersion: common.Int(170)},
ExecutorShapeDetails: &dataintegration.ShapeDetails{ConfigValues: &dataintegration.ConfigValues{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ZQRzp": dataintegration.ConfigParameterValue{IntValue: common.Int(436),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}}}},
InputPorts: []dataintegration.InputPort{dataintegration.InputPort{Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")},
PortType: dataintegration.InputPortPortTypeData,
Description: common.String("EXAMPLE-description-Value"),
Fields: []dataintegration.TypedObject{dataintegration.PivotField{Expr: &dataintegration.Expression{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(387),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_9M9jp": dataintegration.ConfigParameterValue{IntValue: common.Int(761),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
ExprString: common.String("EXAMPLE-exprString-Value"),
Key: common.String("EXAMPLE-key-Value")},
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(942),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
UseType: &dataintegration.ConfiguredType{Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(1),
WrappedType: &wrappedType,
ConfigDefinition: &dataintegration.ConfigDefinition{ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_bRk09": dataintegration.ConfigParameterDefinition{ParameterName: common.String("EXAMPLE-parameterName-Value"),
ParameterType: dataintegration.MapType{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ValueElementType: common.String("EXAMPLE-valueElementType-Value"),
Description: common.String("EXAMPLE-description-Value"),
Key: common.String("EXAMPLE-key-Value"),
KeyElementType: common.String("EXAMPLE-keyElementType-Value"),
ObjectStatus: common.Int(401),
ContainsNull: common.Bool(true)},
ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
DefaultValue: &defaultValue,
Description: common.String("EXAMPLE-description-Value"),
IsClassFieldValue: common.Bool(true),
IsStatic: common.Bool(true)}},
IsContained: common.Bool(false),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(587),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_E742z": dataintegration.ConfigParameterValue{IntValue: common.Int(789),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
Description: common.String("EXAMPLE-description-Value"),
Name: common.String("EXAMPLE-name-Value"),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
ColumnNamePattern: common.String("EXAMPLE-columnNamePattern-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Type: dataintegration.ArrayType{Description: common.String("EXAMPLE-description-Value"),
ElementType: common.String("EXAMPLE-elementType-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(801),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_bnEZr": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(659),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
Description: common.String("EXAMPLE-description-Value")}},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(597),
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_WjbTl": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(970),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}}},
Name: common.String("EXAMPLE-name-Value"),
Parameters: []dataintegration.Parameter{dataintegration.Parameter{IsInput: common.Bool(true),
RootObjectDefaultValue: &rootObjectDefaultValue,
Type: &type_,
TypeName: common.String("EXAMPLE-typeName-Value"),
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_gRIaz": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(54),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue}},
ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")}},
Description: common.String("EXAMPLE-description-Value"),
IsOutput: common.Bool(false),
OutputAggregationType: dataintegration.ParameterOutputAggregationTypeCount,
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
UsedFor: common.String("EXAMPLE-usedFor-Value"),
DefaultValue: &defaultValue,
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(903),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}}},
OpcRequestId: common.String("CKN8SKHKAPNDUW35BGPR<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")}
// Send the request using the service client
resp, err := client.CreateTask(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}