// 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 objectValue interface{}
objectValue = "EXAMPLE-objectValue-Value"
var refValue interface{}
refValue = "EXAMPLE-refValue-Value"
var rootObjectValue interface{}
rootObjectValue = "EXAMPLE-rootObjectValue-Value"
var type_ interface{}
type_ = "EXAMPLE-type-Value"
req := dataintegration.CreateEntityShapeRequest{ConnectionKey: common.String("EXAMPLE-connectionKey-Value"),
CreateEntityShapeDetails: dataintegration.CreateEntityShapeFromFile{Identifier: common.String("EXAMPLE-identifier-Value"),
Types: &dataintegration.TypeLibrary{Identifier: common.String("EXAMPLE-identifier-Value"),
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectVersion: common.Int(169),
Description: common.String("EXAMPLE-description-Value"),
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(450),
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_6kSXt": dataintegration.DerivedType{ObjectStatus: common.Int(64),
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")}}},
Description: common.String("EXAMPLE-description-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(649),
ObjectVersion: common.Int(338),
ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")},
DataFormat: &dataintegration.DataFormat{CompressionConfig: &dataintegration.Compression{Codec: dataintegration.CompressionCodecAuto},
FormatAttribute: dataintegration.ParquetFormatAttribute{Compression: common.String("EXAMPLE-compression-Value"),
IsFilePattern: common.Bool(false)},
Type: dataintegration.DataFormatTypeCsv},
EntityType: dataintegration.CreateEntityShapeFromFileEntityTypeView,
ExternalKey: common.String("EXAMPLE-externalKey-Value"),
ForeignKeys: []dataintegration.ForeignKey{dataintegration.ForeignKey{Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(323),
ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
Parent: common.String("EXAMPLE-parent-Value")},
UpdateRule: common.Int(326),
Name: common.String("EXAMPLE-name-Value"),
ReferenceUniqueKey: dataintegration.UniqueDataKey{ObjectStatus: common.Int(47),
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{Description: common.String("EXAMPLE-description-Value"),
Labels: []string{"EXAMPLE--Value"},
Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(690),
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_DlcID": dataintegration.ConfigParameterValue{IntValue: common.Int(107),
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")}},
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
NativeShapeField: &dataintegration.NativeShapeField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_e4sKj": dataintegration.ConfigParameterValue{IntValue: common.Int(612),
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")}},
DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(false),
Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(268),
Type: &type_},
Type: &type_},
Position: common.Int(313),
ShapeField: &dataintegration.ShapeField{Key: common.String("EXAMPLE-key-Value"),
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_AwdSL": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(814),
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")}},
Labels: []string{"EXAMPLE--Value"},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
NativeShapeField: &dataintegration.NativeShapeField{Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_iBOlP": dataintegration.ConfigParameterValue{IntValue: common.Int(503),
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(false),
Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(862)},
ObjectStatus: common.Int(968),
Type: &type_,
Description: common.String("EXAMPLE-description-Value")}}},
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value")},
AttributeRefs: []dataintegration.KeyAttribute{dataintegration.KeyAttribute{Attribute: &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(493),
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_1QQYN": dataintegration.ConfigParameterValue{IntValue: common.Int(653),
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(145),
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"),
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_fv3pd": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(517),
ObjectValue: &objectValue}},
ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
Labels: []string{"EXAMPLE--Value"}},
Position: common.Int(78),
ShapeField: &dataintegration.ShapeField{ObjectStatus: common.Int(180),
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{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_5w7wF": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(915)}}},
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
Name: common.String("EXAMPLE-name-Value"),
Type: &type_,
Description: common.String("EXAMPLE-description-Value"),
Key: common.String("EXAMPLE-key-Value"),
Labels: []string{"EXAMPLE--Value"},
NativeShapeField: &dataintegration.NativeShapeField{Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(450),
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_XynTJ": dataintegration.ConfigParameterValue{RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(46),
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")}},
DefaultValueString: common.String("EXAMPLE-defaultValueString-Value"),
IsMandatory: common.Bool(true)}}}},
DeleteRule: common.Int(703)}},
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
ShapeId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-shapeId-Value"),
OtherTypeLabel: common.String("EXAMPLE-otherTypeLabel-Value"),
ResourceName: common.String("EXAMPLE-resourceName-Value"),
Shape: &dataintegration.Shape{Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(265),
Type: 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(988),
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"),
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{Parent: common.String("EXAMPLE-parent-Value"),
RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_GILmo": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(308),
ObjectValue: &objectValue,
ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue}}}},
UniqueKeys: []dataintegration.UniqueKey{dataintegration.UniqueDataKey{Name: common.String("EXAMPLE-name-Value"),
ObjectStatus: common.Int(999),
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{Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_oJ5aR": dataintegration.ConfigParameterValue{IntValue: common.Int(945),
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"),
Key: common.String("EXAMPLE-key-Value"),
Name: common.String("EXAMPLE-name-Value"),
NativeShapeField: &dataintegration.NativeShapeField{Position: common.Int(446),
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_mqB9U": dataintegration.ConfigParameterValue{IntValue: common.Int(294),
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),
Name: common.String("EXAMPLE-name-Value")},
ObjectStatus: common.Int(328),
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")}},
Position: common.Int(725),
ShapeField: &dataintegration.ShapeField{Name: common.String("EXAMPLE-name-Value"),
NativeShapeField: &dataintegration.NativeShapeField{Name: common.String("EXAMPLE-name-Value"),
Position: common.Int(203),
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_rQTUG": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(840),
ObjectValue: &objectValue}},
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)},
Type: &type_,
ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_uXlek": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
RefValue: &refValue,
RootObjectValue: &rootObjectValue,
StringValue: common.String("EXAMPLE-stringValue-Value"),
IntValue: common.Int(244),
ObjectValue: &objectValue}},
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"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
ObjectStatus: common.Int(980),
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"}}}},
Key: common.String("EXAMPLE-key-Value"),
ModelVersion: common.String("EXAMPLE-modelVersion-Value")}}},
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
OpcRequestId: common.String("V5ALS3QUGZXQZJRWYA4E<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
SchemaResourceName: common.String("EXAMPLE-schemaResourceName-Value"),
WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-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)
}