// 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).

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.DataintegrationService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Dataintegration
{
    public class CreateWorkspaceExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var createWorkspaceDetails = new Oci.DataintegrationService.Models.CreateWorkspaceDetails
			{
				VcnId = "YFRYpolQk00jIAF2X8Nz3C5T42RPc0WasrXXQSa4nSKoK41Zb4U6Z2kEzQgLJOkmZa7u9HWgswPRC8TSLJ2XZKRQsBfhd059hDf3hPIDhNia4V1pfL1G3pgvkzEwxqbADffYR9H9o1er28Y9kNCTWyHWwGDyt8CfznHrosHViiFOzzheOvy8BTkiCbz1NyWoJiK6YJ2XL7Bbm9mj7XLRjSswVZlLYzlFFbaX2Cps7lIuDe56NGjRfctjBIB8I6c",
				SubnetId = "6Je1JBjSoUsdnGu3Iy0G3DeDiW8hcZrYkDdadQDXOgeeGiWIn9POtwIRAal7hXaGcubjTQvye1MxVhN0wUalmRf09qqx0hSSHqhgIxrkH2RPUUgN2bUPbBYlNsYuapqJ8lTqooPYgHvUf21Zs82R4HhC7aNsdkLcQN5BiQQtSwc9Svgt2Tvlcnw0vYDKS5L0LuW3eyfLCFaeBeDzmOlSnkCYOg5CSZinUbIL5j01FYamFc4luSAGFT2Uyrz6hof",
				DnsServerIp = "EXAMPLE-dnsServerIp-Value",
				DnsServerZone = "EXAMPLE-dnsServerZone-Value",
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_pDkt9", 
						"EXAMPLE_VALUE_vaCqeCx6iCVuAHglkrqt"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_n7uDN", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_W1teA", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				Description = "EXAMPLE-description-Value",
				DisplayName = "EXAMPLE-displayName-Value",
				CompartmentId = "gdulBobIZW415xbsUFk5o51UTpx8wHGG04QsGVEfKDidxAVbygsBqOgyFf5UATS3Cq7EyOIWIoDZPPVci7i6gLwWgkzMYSgGEfA9pZo9j1CSzEt8D29L8MQ7or6SfLBDpcTwXHs7Riwfce6b6MDd1NeTOq8Pm9Lah7L52umG1TH2fY5fG6RLBsT6pnertlDQ8I0DufjaQ2eN3Ptpbz3ZHFpoNhKWQv9f6GXrzHgjIic6UevHJH80eOlpkuO92EK",
				IsPrivateNetworkEnabled = true,
				RegistryId = "ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value",
				EndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value",
				RegistryName = "EXAMPLE-registryName-Value",
				RegistryCompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-registryCompartmentId-Value",
				EndpointName = "EXAMPLE-endpointName-Value",
				EndpointCompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-endpointCompartmentId-Value",
				WorkspaceProperties = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_gPiNy", 
						"EXAMPLE_VALUE_lFXfJd9pd7HEJCaIr8eB"
					}
				}
			};
			var createWorkspaceRequest = new Oci.DataintegrationService.Requests.CreateWorkspaceRequest
			{
				CreateWorkspaceDetails = createWorkspaceDetails,
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
				OpcRequestId = "G8VQUUAADKYCVIFRGQ8U<unique_ID>"
			};

            // 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. 
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            try
            {
                // Create a service client and send the request.
				using (var client = new DataIntegrationClient(provider, new ClientConfiguration()))
				{
					var response = await client.CreateWorkspace(createWorkspaceRequest);
					// Retrieve value from the response.
					var versionValue = response.httpResponseMessage.Version;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"CreateWorkspace Failed with {e.Message}");
                throw e;
            }
        }

    }
}