// 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"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
VcnId: common.String("2vmlPzWkpGCKTrehfsC0PEySDqvVh4A6y6ppv5ljKhWl6wPI6m39r2ImRfoTnvHpucYtD8WQ0JwutyeIFY0YWE5PfYnWuGaU1JfRRHKP10lpMcTsfSDyMfebD1iDdCI3N1FyVWheyKLYTtmaOe4vQJcDMrhMVmeGmq6HqgWM3jzYZsvQymzpLOR3WCxLVFoMA0JjJDQ5c2EglW1Dy0rlHf4rpqkJyfBvalLD5EPRxBfk8wm0CswCz6XTECdnsoD"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_Ed8Ya": "EXAMPLE_VALUE_oodFsAvaCtS7GTvKhHK3"},
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_DvPXU": "EXAMPLE_VALUE_VatT0KP23LPjDs9rQTUG"},
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_0mRPt": map[string]interface{}{"EXAMPLE_KEY_kfUZH": "EXAMPLE--Value"}},
Description: common.String("EXAMPLE-description-Value"),
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
IsPrivateNetworkEnabled: common.Bool(false),
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
CompartmentId: common.String("XM3sh8lSkJ5KOVUyzjvnufjO1pbjLcJtPnzH6x2nrA7z71iYvLYfZr218GZms1ebPJJ2VjrsbSyOdZCMpa1QjvocFVtZ9Bp5xeNlVHNEOyBXYDkmuXApCpIx6RUr6wbBk9jpnMWh0nafTGJuoPHSrryCkEBayn4XUxq770ahVWcx0Y9VQIEQEPuKdVynHoO8ekazl1qnvKe2a7kJOf7ClHNhZCHrznNo19KKoMaNA5WYCpX8APQTjyzNiD9yVMC"),
SubnetId: common.String("uwg9tToLd7vRt4GUjq8HLWHSAjMSJNVWJiooxpoSYgHnaEbNSnozo8lSVWxUEIZqu1d0BbxGy2l9HDDDY1xhxQ4Dewi6ZOF1QhuaGmiKxgEurNd8dC7EZjXGeH1YEGILmo7TOxK6kSXtqdBtqkBcPUosbTQHtv9no8VKkf0sH7KBSE4Otj4O15fEL7F2VRDRgiqQkxb0tP7RPuXlekg7pRB1NvsYjqg5pdrjFJ3oWIUxDGVkAMWeDTAFqNzm1VA")},
OpcRequestId: common.String("VUWP2WYDQSO9SDZTHW62<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)
}