// 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 = "WBOOIpEUPkC0UFIezWLcoSBkZwA4gr051QGx0kqQTXktZLLeEGzpYgS6VKwAjBeh6xFKGEzG6TyY6m2lvnRUghLsVO2CRoMltedGfa7T7ppZR7k5de74G2PwH6ObVermAjS9Y7526xHu8M5PRfCmpOj132qM57wcOt07rJIZtX3KfLUztuGe6CktS8vOik8nTX28VGeZzS3vQzgL24DvnqzqGDXkC2qLrhuQRhqqBWNgrnC80NpWiGxSgjW20nP",
				SubnetId = "QrttEvFICLxCyE5FwpXAhkS7BLXqdLwpPEJYkpBbw54eF0Yis8pIjmozVhP2e77hyaOHBao2YMxMwpNj9vTTAqN4js5vqBR71BEt6TgYhzSsls925ED713aInQ0HEnlKCEVm1022aS6k44yDQQbvmAxEva2YOuOIdoyqXV3n2tRiwfJuNgFhanjcgk3gnXLW2zh7QVFsMVLjWYB6OI2YYmORhyZrELWw2Pq9QHHlAsj5C7yYXQZ62SX6GUYma3f",
				DnsServerIp = "EXAMPLE-dnsServerIp-Value",
				DnsServerZone = "EXAMPLE-dnsServerZone-Value",
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_Cj5lb", 
						"EXAMPLE_VALUE_tpC1zwvFL0dlgnCZTY5u"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_Fp9TJ", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_qcPeU", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				Description = "EXAMPLE-description-Value",
				DisplayName = "EXAMPLE-displayName-Value",
				CompartmentId = "GxA9vvtk0EftD9yvhn5cPOrEufky9dnuIHw9TCB6w5SdFWPsULSQUNCAczIuNPq56lA5SyCcxJKwQbW4eKKtEvIOdPOdwRBGoRnFvcCLbO8qYPzgrtOwGTBPiZM9mFpAoLkcDdzbFuPhjho4hc708Xv3nxm7TmJOil5Br8PmLTGGFyIOd5CqGQyusHt3tsVC38dKC04qJfg4UmFl9iKNOPY63xVl8wdiIzHEE0m8YrLZ2IPGbK2L73yO05QfU1r",
				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_vsOkl", 
						"EXAMPLE_VALUE_G5HutHvfGVkIIzkN8TNt"
					}
				}
			};
			var createWorkspaceRequest = new Oci.DataintegrationService.Requests.CreateWorkspaceRequest
			{
				CreateWorkspaceDetails = createWorkspaceDetails,
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
				OpcRequestId = "97YFNSE7N6ZIOOR2ALHK<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;
            }
        }

    }
}