// 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 ExampleCreateEntityShape() {
// 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 refValue interface{}
refValue = "EXAMPLE-refValue-Value"
var rootObjectValue interface{}
rootObjectValue = "EXAMPLE-rootObjectValue-Value"
var objectValue interface{}
objectValue = "EXAMPLE-objectValue-Value"
var type_ interface{}
type_ = "EXAMPLE-type-Value"
var defaultValue interface{}
defaultValue = "EXAMPLE-defaultValue-Value"
req := dataintegration.CreateEntityShapeRequest{WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
ConnectionKey: common.String("EXAMPLE-connectionKey-Value"),
CreateEntityShapeDetails: dataintegration.CreateEntityShapeFromFile{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
UniqueKeys: []dataintegration.UniqueKey{dataintegration.UniqueDataKey{Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(389),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
AttributeRefs: []dataintegration.KeyAttribute{dataintegration.KeyAttribute{Attribute: &dataintegration.ShapeField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_o3IBG": dataintegration.ConfigParameterValue{RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(51),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value")}},
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"),
Labels: []string{"EXAMPLE--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")},
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
NativeShapeField: &dataintegration.NativeShapeField{DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(true),
Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(135),
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_MlJsa": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(104),
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")}}},
ObjectStatus: common.Int(953),
Type: &type_},
Position: common.Int(609),
ShapeField: &dataintegration.ShapeField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_65UtS": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(23),
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"),
Key: common.String("EXAMPLE-key-Value"),
Labels: []string{"EXAMPLE--Value"},
Name: common.String("EXAMPLE-name-Value"),
NativeShapeField: &dataintegration.NativeShapeField{Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(712),
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_MMtaz": dataintegration.ConfigParameterValue{IntValue: common.Int(847),
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")}},
DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(true)},
ObjectStatus: common.Int(2),
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")},
Type: &type_}}}}},
DataFormat: &dataintegration.DataFormat{CompressionConfig: &dataintegration.Compression{Codec: dataintegration.CompressionCodecLz4},
FormatAttribute: dataintegration.ParquetFormatAttribute{Compression: common.String("EXAMPLE-compression-Value"),
IsFilePattern: common.Bool(false)},
Type: dataintegration.DataFormatTypeXml},
ResourceName: common.String("EXAMPLE-resourceName-Value"),
ShapeId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-shapeId-Value"),
Types: &dataintegration.TypeLibrary{ObjectStatus: common.Int(120),
ObjectVersion: common.Int(942),
Description: common.String("EXAMPLE-description-Value"),
Identifier: common.String("EXAMPLE-identifier-Value"),
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")},
Types: map[string]dataintegration.DerivedType{"EXAMPLE_KEY_WEz7l": dataintegration.DerivedType{Description: common.String("EXAMPLE-description-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(318),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
Key: common.String("EXAMPLE-key-Value")},
Description: common.String("EXAMPLE-description-Value"),
ObjectVersion: common.Int(100),
OtherTypeLabel: common.String("EXAMPLE-otherTypeLabel-Value"),
Shape: &dataintegration.Shape{Type: dataintegration.JavaType{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"),
JavaTypeName: common.String("EXAMPLE-javaTypeName-Value"),
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
ConfigDefinition: &dataintegration.ConfigDefinition{ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_OakG8": dataintegration.ConfigParameterDefinition{ParameterName: common.String("EXAMPLE-parameterName-Value"),
ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
DefaultValue: &defaultValue,
Description: common.String("EXAMPLE-description-Value"),
IsClassFieldValue: common.Bool(false),
IsStatic: common.Bool(false)}},
IsContained: common.Bool(true),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(496),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(71)},
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_pewIj": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(306),
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")}},
Description: common.String("EXAMPLE-description-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")},
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(632)},
ExternalKey: common.String("EXAMPLE-externalKey-Value"),
ForeignKeys: []dataintegration.ForeignKey{dataintegration.ForeignKey{AttributeRefs: []dataintegration.KeyAttribute{dataintegration.KeyAttribute{ShapeField: &dataintegration.ShapeField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ie1Wx": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(318),
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"),
Labels: []string{"EXAMPLE--Value"},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(742),
Type: &type_,
Key: common.String("EXAMPLE-key-Value"),
NativeShapeField: &dataintegration.NativeShapeField{Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_cRVKg": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(695)}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(false),
Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(692)},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
Attribute: &dataintegration.ShapeField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ux5qY": dataintegration.ConfigParameterValue{IntValue: common.Int(874),
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")}},
Labels: []string{"EXAMPLE--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")},
Description: common.String("EXAMPLE-description-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
NativeShapeField: &dataintegration.NativeShapeField{Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(573),
Type: &type_,
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_fsLTT": dataintegration.ConfigParameterValue{IntValue: common.Int(181),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}}},
DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(true)},
ObjectStatus: common.Int(0),
Type: &type_},
Position: common.Int(745)}},
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-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")},
ReferenceUniqueKey: dataintegration.UniqueDataKey{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(898),
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
AttributeRefs: []dataintegration.KeyAttribute{dataintegration.KeyAttribute{ShapeField: &dataintegration.ShapeField{Name: common.String("EXAMPLE-name-Value"),
NativeShapeField: &dataintegration.NativeShapeField{DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(false),
Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(73),
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_WU7XU": dataintegration.ConfigParameterValue{IntValue: common.Int(665),
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")}}},
ObjectStatus: common.Int(211),
Type: &type_,
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")},
ConfigValues: &dataintegration.ConfigValues{ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")},
ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_lp4IU": dataintegration.ConfigParameterValue{IntValue: common.Int(153),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value")}}},
Description: common.String("EXAMPLE-description-Value"),
Labels: []string{"EXAMPLE--Value"}},
Attribute: &dataintegration.ShapeField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_61PjU": dataintegration.ConfigParameterValue{RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(17),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-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"),
Key: common.String("EXAMPLE-key-Value"),
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")},
Labels: []string{"EXAMPLE--Value"},
NativeShapeField: &dataintegration.NativeShapeField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Jglob": dataintegration.ConfigParameterValue{RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(444),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value")}},
ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")}},
DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(false),
Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(148),
Type: &type_},
ObjectStatus: common.Int(635),
Type: &type_},
Position: common.Int(677)}},
Key: common.String("EXAMPLE-key-Value")},
DeleteRule: common.Int(765),
UpdateRule: common.Int(448)}},
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(312),
EntityType: dataintegration.CreateEntityShapeFromFileEntityTypeQueue,
Identifier: common.String("EXAMPLE-identifier-Value")},
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
OpcRequestId: common.String("NL7ZJXPTARNF9U0VADWZ<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
SchemaResourceName: common.String("EXAMPLE-schemaResourceName-Value")}
// Send the request using the service client
resp, err := client.CreateEntityShape(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}