// 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{Description: common.String("EXAMPLE-description-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_x7iPC": "EXAMPLE_VALUE_gRqKEEpQQWeC2BJafiC1"},
RegistryCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value"),
RegistryId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value"),
DnsServerZone: common.String("EXAMPLE-dnsServerZone-Value"),
EndpointName: common.String("EXAMPLE-endpointName-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_4xiYL": map[string]interface{}{"EXAMPLE_KEY_eSf1P": "EXAMPLE--Value"}},
DnsServerIp: common.String("EXAMPLE-dnsServerIp-Value"),
EndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value"),
WorkspaceProperties: map[string]string{"EXAMPLE_KEY_RLB6h": "EXAMPLE_VALUE_9bzMkC7UVrAXDIyWjbTl"},
CompartmentId: common.String("bxMM5sxS0IPy4ralRmj6TdF7mNNLdHoKUmo5by1VzEAUpznB0tGuYYpbU26sOf0mbC1OGCabvwURYmeQ3pUgWourDTeqANkAz2IENFwiZKUJq3SzAYOrnNOoMu5GlqqonsjqE3IM0YL3eGtbC6cTz4uWqYkZWUd8JiBFxV1FzYRLVbHkpLDZ5QAG9txgPA38txtkv4Apf5fnxbmt7OADqTZ8L3xupBxFFHxdthSN3DL2qHoORPlLp0vTgY6lHzF"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
EndpointCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value"),
IsPrivateNetworkEnabled: common.Bool(false),
RegistryName: common.String("EXAMPLE-registryName-Value"),
SubnetId: common.String("7L11Rb5i00PTsvt5u5ZeYPqtD7keXRLS6mXNQmG8P2xf63v5cVZ7udxpNt0mf7Ot2KE48sPtnjNGwJznWTgS5TfUnEXKGtOBzfjAsJRyJWGkhkvrIlsnNRZ74HFSgmw3MNItGBEmivclbwlcrJhWTq2nur8QOXpzvRONj7QTxgGElCNx8RQHbGCXcBeRlos81Mb8fsDw76i15Hvca4XDGq7wuLSiBfjjEAbL04Dyp7aEMslSI2xIcl3qpuDsBfs"),
VcnId: common.String("BSu8b8lE9MhQxB8Af1WuLc03oJ0TifHe6nnR4IIlll7qcqlsIkQd0Dh77DQLKWuEvIAYGDF1l51IJMgeJerKekomMERYwgDOVff5bFZupMqeYsi3bJ99e6szegH9hwMNYc46NYqfKpmwGciSkWz0qYltKYkZjmeizSYDDessa39eY5sI4AzlCTA9eL0EnhESqYbTd8WGLj9O89BXnJdGFKqgrLz6QuI0YavBIK6RRVnAMACy9bWch9gN0QCRRPF")},
OpcRequestId: common.String("PWKT1OV3JHI4WFPRZUFT<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)
}