// 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"),
Description: common.String("EXAMPLE-description-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_bhZRU": map[string]interface{}{"EXAMPLE_KEY_Qy3RJ": "EXAMPLE--Value"}},
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_vx5At": "EXAMPLE_VALUE_ssifMl4044Z9XII1LOlF"},
IsPrivateNetworkEnabled: common.Bool(true),
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
SubnetId: common.String("nAb8sQvX9ywdwwtdsCiUI0nz2uFyNROGKnWqHtuGWpGDNI0m3D6JxAuBucWxNn2OZ9JFBsR4K1GMQDZOzhqpSm11L0pqyNkMISAmnuoGqcSzUkLY6axBbur0s1EIDnBfoOLhGxj8ZcpsPdXKW7JEG896LPsejtq38umXkk1qM01KmruvxiCocpABM19XiF7EKPEbxgHksuLmDjtlMRGeau5eJoCE2RqKIunYMDOAwiDReLfaMHqon4nSxbLHA5W"),
CompartmentId: common.String("dNu2cnmaoNeZ49zE8E8JIAg2L0ZXJEG0x33RDJZf8GgPx0qu7aC7jLLj7H1d80r5K9Ih9DvG0Xbe1Q8q2uuYZ485dGuNsQK4VYfP7DMZmTRRFSUJ9JFGcQvKCJKWF1Zg7g11KCUwTU3aG8m3ySGp8b0GQ31VPNwbm8fsQteqBReHvfKcMI55OBG2mnmNTnenwSwpaxuxhpn0p8ViDVO2ZMeMUHoeAW0qP6cIY4VVhLsZzlmt2Wh8iDINJqFYxTn"),
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
VcnId: common.String("NqMxmbF85IKR8KsRCNJORmCiJV7jiwu6kdIeodSyd6brRXUY0nwvd44V8cVtb6Wiv2XScZruZbsqUbJGLKJdLHfXxsf0m6J1XYzLrrSxcjA57Zhwl9ey8w5WvBp5gLpz43tQoXRM4cmdDYwGK52HAYpVJxmMFuKlY0AJuIAuDWZi1lOaOKPRGhFn8moRgo4gkxWWKJc6stOJLgmpcmeiwWjw1k1F4Be0qCcjoBhgvtHoegy3mt6rJj1WhpRtzZO"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_1KCVj": "EXAMPLE_VALUE_ppaWrKclCpnUiOysNdb6"}},
OpcRequestId: common.String("TOXXTLA1AA0LC0NHOTSJ<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)
}