// 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{EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
IsPrivateNetworkEnabled: common.Bool(true),
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"),
CompartmentId: common.String("ov54a9oKgGWbSWJibP4p2qXgBzI8PEv6dVENqGRgj29azoIxIwSYzGI1e00MeaELDU8evmxzX9EmcyGLS0EP8vYlSFGSqf5t28Ok6nt1GqjHOHg6JoWMurI6HFOYuxUJV4yX39s8TuXQMJ1QH91dnsCnspmaU7vNqArZOjSsPQ2uw5oWxczl1ujEMMVL0v5ulmbhhxebEZAr4QmRNAyo5xwdusFHHyyQr5W4AargtC9pHkmU5Bq2Ybt7piQc1Kx"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_2eLoB": map[string]interface{}{"EXAMPLE_KEY_xV1td": "EXAMPLE--Value"}},
DisplayName: common.String("EXAMPLE-displayName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_EjPZQ": "EXAMPLE_VALUE_6DVHpltz1oGBk8fvmnl4"},
VcnId: common.String("rNHGuEUWEVO1PkqQN4Gdv1a7LpcezrCxiz6OrpbG02amxHhPQ5HsTNaFWVNJZzyiuqTymZtMA3QG1NdtiAXL8fxUuxKcmFUlljXFTrE6svx4YRYow8y6uajJtiQVEJ2EAJFILpZBVdj8bkggXgxPfciHKRwkwl6BAniUYu2olxFgKO9OdXww9BoBmyzR82A1Xjz3gkGKardQJRDdSQOAo6L707QyUawh8JRwEFLMiVsKVFU8n5bnwCuCKuvOr0A"),
Description: common.String("EXAMPLE-description-Value"),
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
SubnetId: common.String("VfIyrjLHZyorNuD4WC0ijAt3Bq9ZvECR929xaFeXBOavx7JnqCsoy4SfVlDErHepv3pkLuTnJ0XFMr92Z2MUASeNeQtfmozp1QZmoH3EgOuoI5edjIBnidIFf1oL6ilx5BhxESW7E7kRBqU1dNcc8yAQiC1udt4jUz7edfE4nkIpeDvEgfPyFrOXHoA1OwA8UVgtLX5lmAdVH7T7rPjiYoukAipM9Ho8oF4xWlfo3jX6dXdqFeT70LnP8Y6F46k")},
OpcRequestId: common.String("EJRQBS2HOQ7YXZG60R8L<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)
}