// 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{EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_kgyuc": "EXAMPLE_VALUE_8YRaX70CB6RYnysiy8mF"},
CompartmentId: common.String("zKd1LzGkMs4siebTm6ItI7QM31DtXUjepnXfNRLB0R0Ljo4SdfuNLj3Q7rR5uxrteJI5IFTn1zVSlalICCceOsnkYoEKfqu8LeyroWtQHP9Bwp9hVBhZZgvISJE1AoWLeqAmGYybUvMrvFZZyOZTqLHJvP9tKTsmtl9EFedpaCK5tR4w7srVeuL9WJtxU086t8VYn9VmRQXgkdrdEQT2RNOtzdKrI0F14fi99pa5R4qpOGvuNSlWs8LAhRWCZiv"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_KToER": map[string]interface{}{"EXAMPLE_KEY_XuSBA": "EXAMPLE--Value"}},
Description: common.String("EXAMPLE-description-Value"),
IsPrivateNetworkEnabled: common.Bool(true),
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
SubnetId: common.String("ipRmRky6S7tHFldRYuEh1gdT7XpTqQ7fHBKPqomYe7IFhlrkinCdFl1W1r7BYXmcZxFiT0zBPpRvjkHTXwY3Rj33VpdpEw2IKlHtcg2pjPqbpIo6OxZl8slnPY9zciMqRDUERK0BzfUyZRATcM5DqsPjFyB9QEST3IOei5gybe2dbBljq3EImGNrWiWBSAUVd5tT1HhFVQwg3HG7PzzOlWVQRGMki9PmJKUZU2XYqRcbOqUhAsmbh74VN8Bz4Me"),
VcnId: common.String("S8Wo0TPJlGXDtEHXRiY3yseRNSnlhOc9Z26tNphDw0q5HVUqglLVZjgPfIiwpBZ5sxBXRt6ztXnMD3LFBlqtktZTQASjR0SK6XXMENdTYde82p8WXmvvZnMDNPdJ5ynzZEpxqd186zwENh9hU0DSPKHKuBSKMU7JDYrLbe1e4XB04IGpeqNy0MwhVspJccIayux669X8dFl7ijXo7XYOc4wjDZscnVveYrABnpWb5CLyxeCQDzYYVPAGcW0U9LF"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_lyeIc": "EXAMPLE_VALUE_vdQww7NKb6R0qkLyidAI"},
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value")},
OpcRequestId: common.String("QF1X6H2XOMSBR7RMRUC1<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)
}