// 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 ExampleCreateWorkspace() {
// 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).
req := dataintegration.CreateWorkspaceRequest{CreateWorkspaceDetails: dataintegration.CreateWorkspaceDetails{DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_D7P0k": "EXAMPLE_VALUE_7YOIivmjzvcrVhvNSNia"},
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_HYs6x": "EXAMPLE_VALUE_C11SdiBXIOKsTz8dBisP"},
CompartmentId: common.String("JmgxMuv8p5NEp9XVwsp6W1fcf9wqzvCjXPU1AeS1PvuvO4MF7zfwxMGopquyE2pCTdToxGMhPXWptO9VI8tcD71ryKojZZTkBT5n1u8CvxvRJXeVH86r9loB66fXViLinZLxNXLsffFO0zuZg13p6sWanzGcfPFJ8uzCt7h05XYDFNZo0FIadKj51irwInvhvvg7ywY69dTaU0duGSfVL1w3caZ3j82rkWdBTBngbct6TI4DkT6BnYHCC1cH9rB"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_Cxuk6": map[string]interface{}{"EXAMPLE_KEY_vV47d": "EXAMPLE--Value"}},
Description: common.String("EXAMPLE-description-Value"),
IsPrivateNetworkEnabled: common.Bool(true),
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
SubnetId: common.String("BtP4EvRwcUqLodYiP0yHdbzUPTeSrc6xwLesZafBPeailctPWQ6tB6cdHasHvv9FrzeoplrUXcZznVxM6nLcKb5xO7QQikHoezfMk98Jk6FLxT4HNP1RJ4VNaEmh5QrQ7pPr4Cks8AYvNPXUa47lA5d9hmG6Vd4bjDkUfHMLw0kFHU4ZDJTBQCknQJMkEWDKPo0OiHgW5Idizb6AnCEzPAVQIx8m8o1ODIAakdLiNezTTmFm118GxyCPF4K8mZQ"),
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
VcnId: common.String("aqEMmxuFjKl1AfqSsZrGNt7eyf0m4xb8CHtb93O9bG8DXIWfDfIy3dUy7HPaskNvxMVNHkGggEBNDWz2ucspoAnFLFCZxMsKvV4jULHJ5uRvqK3bvdSnrAWUHFrgvy4OOjIEjPeguyGNOvbu1g2WkCOOTSEZDXqybOKMtlruZfHPxkevYGLmKbzb1MEA8UeMjU87QO1hLpRYuA4ls1cDqDeRA6vBOBaw2nN2VvmhQNwSCnXlAZJ3Nlya88iMOd0")},
OpcRequestId: common.String("EUO7DMNUJSVOORCFXKMH<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}
// Send the request using the service client
resp, err := client.CreateWorkspace(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}