// 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 = "d6gikPRFDEdOeiT9hNvg3EOkOAcR5km9qJGdZ9wCkqQZiY2h4YOeh3stYCVuFZp9pXMiDtpnn8Rta9DUMnVeLaRvxFoQEBsyMxIPdV5E8algzZf5iXqlyt4ZezNnvXUTtiypw9yRxDTsR8S700STxWRQaCIy6x1GbMdyKqVmD8snO9WTjUPtx8kAf1uXlOB2ssDEHeknKBdh98JNkiv2jfaMmuR19OskOJOX0vy7dtnLklJgrrXPHBZv7F78BjG",
				SubnetId = "lhjNL1T5O3Lk6RQoGeabVDT21CLhjlIPuc9xmGLLtAUv69ZEVQUV2PXRVdJKl7F9FheRP8dEL75AQJjTHg9QLHnK1uQpoFSoVTD52qXWI4sG431XUAgJ8rwRzLUH6GRP1Oi4vw6JpH7DrDM55iGkBZk4R7ApebxMM5sxS0IPy4ralRmj6TdF7mNNLdHoKUmo5by1VzEAUpznB0tGuYYpbU26sOf0mbC1OGCabvwURYmeQ3pUgWourDTeqANkAz2",
				DnsServerIp = "EXAMPLE-dnsServerIp-Value",
				DnsServerZone = "EXAMPLE-dnsServerZone-Value",
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_IENFw", 
						"EXAMPLE_VALUE_iZKUJq3SzAYOrnNOoMu5"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_nsjqE", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_Glqqo", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				Description = "EXAMPLE-description-Value",
				DisplayName = "EXAMPLE-displayName-Value",
				CompartmentId = "AKTazme6j2o3BP1k20A3tPoXMi0phuYhK87kqzgdAlXB4LhNhJ4VHW7Vc0oYiCtacJmSEoAhL01c334xSEFLwyyeHRezOApfXeiefjPa7HAYmHA8rSb8vjcHvAlAbAGLfPVvUWd8LVmbt89msQEAIDMgaGF9YBkuPJ5GNDngLWZKN5eZiXs3NmNb6clTfkZKqIKJijWjetGtgkRvZqySJaHXJ3Mp5hIYcKHgKebYVLVpIGOiBdgoazXLjkGledb",
				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_M0YL3", 
						"EXAMPLE_VALUE_eGtbC6cTz4uWqYkZWUd8"
					}
				}
			};
			var createWorkspaceRequest = new Oci.DataintegrationService.Requests.CreateWorkspaceRequest
			{
				CreateWorkspaceDetails = createWorkspaceDetails,
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
				OpcRequestId = "JIBFXV1FZYRLVBHKPLDZ<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;
            }
        }

    }
}