// 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{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_z0TU1": map[string]interface{}{"EXAMPLE_KEY_pvfXL": "EXAMPLE--Value"}},
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
CompartmentId: common.String("Rky6S7tHFldRYuEh1gdT7XpTqQ7fHBKPqomYe7IFhlrkinCdFl1W1r7BYXmcZxFiT0zBPpRvjkHTXwY3Rj33VpdpEw2IKlHtcg2pjPqbpIo6OxZl8slnPY9zciMqRDUERK0BzfUyZRATcM5DqsPjFyB9QEST3IOei5gybe2dbBljq3EImGNrWiWBSAUVd5tT1HhFVQwg3HG7PzzOlWVQRGMki9PmJKUZU2XYqRcbOqUhAsmbh74VN8Bz4MelyeI"),
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
IsPrivateNetworkEnabled: common.Bool(false),
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_5X4JD": "EXAMPLE_VALUE_WRT2jDUMnup3djCkFYuk"},
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
SubnetId: common.String("HEO6Ui1ipJ3FVphB38RoadcnEV2MIQerdMfq78kdQs6dR6elhtqSIz0YVCx24Hk25lmf9Zr7qlQFgTHyq79r3uLxOS3OQUyWLBEEQB0WvCr7RfgeZu0EENgSAeUyPvI5TGNCV3yEoztQImfrQETkFLcWBvG82MfaBMZjTp2M8OgRFKZCrQZy8geb7A5vhQlbWicKyNn0VnWXpEjH1S6epwZ6Ahu7ADDpYyzOBA5mBTQjTca1cafFGbCkOGfZYLb"),
Description: common.String("EXAMPLE-description-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
VcnId: common.String("cvdQww7NKb6R0qkLyidAIXuSBAKToERb1kgyuc8YRaX70CB6RYnysiy8mFQF1X6H2XoMSbR7rmruc1Ph4zmd23JBTHtBus9nfAfH1SUil2x2JAAYoCKFkipBBvYt3bflb50yI5LVk2YT2KP33OSDvXsDefbkMkJ3Sqm7bcqHaHAiTmcZ5btiw1UhMYDEFMB7WRB2zS5jh3ThXm9leeIG9k9KTitA1oBpeowZnwmh3iebr1bs3QqxjhGbjHhrxn4"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_fXBaO": "EXAMPLE_VALUE_Xvlfo1kWpFExxgrW94bW"}},
OpcRequestId: common.String("82JG5AJ2QM9WFPGON1H3<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)
}