// 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"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_A5Ld1": "EXAMPLE_VALUE_imqAtceAzgP1HvDzhdy9"},
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_9ng22": "EXAMPLE_VALUE_65VjE6pgO9Ix8pXRmocN"},
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
IsPrivateNetworkEnabled: common.Bool(true),
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
SubnetId: common.String("Uf21Zs82R4HhC7aNsdkLcQN5BiQQtSwc9Svgt2Tvlcnw0vYDKS5L0LuW3eyfLCFaeBeDzmOlSnkCYOg5CSZinUbIL5j01FYamFc4luSAGFT2Uyrz6hofpDkt9vaCqeCx6iCVuAHglkrqtW1teAn7uDNwLgPiNylFXfJd9pd7HEJCaIr8eBG8vQuUAAdKyCvIfrGQ8UeOy3iradUj08Tpi971mrHbb5gSykpB4KEpHpWArMTqseMgNVMpdtgvCU0"),
VcnId: common.String("r28Y9kNCTWyHWwGDyt8CfznHrosHViiFOzzheOvy8BTkiCbz1NyWoJiK6YJ2XL7Bbm9mj7XLRjSswVZlLYzlFFbaX2Cps7lIuDe56NGjRfctjBIB8I6c6Je1JBjSoUsdnGu3Iy0G3DeDiW8hcZrYkDdadQDXOgeeGiWIn9POtwIRAal7hXaGcubjTQvye1MxVhN0wUalmRf09qqx0hSSHqhgIxrkH2RPUUgN2bUPbBYlNsYuapqJ8lTqooPYgHv"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_1RHcj": map[string]interface{}{"EXAMPLE_KEY_G83MZ": "EXAMPLE--Value"}},
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
CompartmentId: common.String("fce6b6MDd1NeTOq8Pm9Lah7L52umG1TH2fY5fG6RLBsT6pnertlDQ8I0DufjaQ2eN3Ptpbz3ZHFpoNhKWQv9f6GXrzHgjIic6UevHJH80eOlpkuO92EKYFRYpolQk00jIAF2X8Nz3C5T42RPc0WasrXXQSa4nSKoK41Zb4U6Z2kEzQgLJOkmZa7u9HWgswPRC8TSLJ2XZKRQsBfhd059hDf3hPIDhNia4V1pfL1G3pgvkzEwxqbADffYR9H9o1e"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
RegistryName: common.String("EXAMPLE-registryName-Value"),
Description: common.String("EXAMPLE-description-Value")},
OpcRequestId: common.String("1CNRY2BPN4GYXOV33FIF<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)
}