// 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{RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_g3HG7": map[string]interface{}{"EXAMPLE_KEY_hFVQw": "EXAMPLE--Value"}},
EndpointName: common.String("EXAMPLE-endpointName-Value"),
IsPrivateNetworkEnabled: common.Bool(false),
SubnetId: common.String("IGpeqNy0MwhVspJccIayux669X8dFl7ijXo7XYOc4wjDZscnVveYrABnpWb5CLyxeCQDzYYVPAGcW0U9LFipRmRky6S7tHFldRYuEh1gdT7XpTqQ7fHBKPqomYe7IFhlrkinCdFl1W1r7BYXmcZxFiT0zBPpRvjkHTXwY3Rj33VpdpEw2IKlHtcg2pjPqbpIo6OxZl8slnPY9zciMqRDUERK0BzfUyZRATcM5DqsPjFyB9QEST3IOei5gybe2db"),
CompartmentId: common.String("DjrLxCFbciqF34GSHIHMzltZAB6fSK4iMzI4IgU5L2KzUrwXXjPIjzN0BCbm0eDh2NRLG1rSrYL4e3igi5zKd1LzGkMs4siebTm6ItI7QM31DtXUjepnXfNRLB0R0Ljo4SdfuNLj3Q7rR5uxrteJI5IFTn1zVSlalICCceOsnkYoEKfqu8LeyroWtQHP9Bwp9hVBhZZgvISJE1AoWLeqAmGYybUvMrvFZZyOZTqLHJvP9tKTsmtl9EFedpaCK5t"),
Description: common.String("EXAMPLE-description-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_Bljq3": "EXAMPLE_VALUE_EImGNrWiWBSAUVd5tT1H"},
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_zOlWV": "EXAMPLE_VALUE_QRGMki9PmJKUZU2XYqRc"},
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
VcnId: common.String("R4w7srVeuL9WJtxU086t8VYn9VmRQXgkdrdEQT2RNOtzdKrI0F14fi99pa5R4qpOGvuNSlWs8LAhRWCZivS8Wo0TPJlGXDtEHXRiY3yseRNSnlhOc9Z26tNphDw0q5HVUqglLVZjgPfIiwpBZ5sxBXRt6ztXnMD3LFBlqtktZTQASjR0SK6XXMENdTYde82p8WXmvvZnMDNPdJ5ynzZEpxqd186zwENh9hU0DSPKHKuBSKMU7JDYrLbe1e4XB04")},
OpcRequestId: common.String("BOQUHASMBH74VN8BZ4ME<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)
}