// 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.DatascienceService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Datascience
{
    public class CreateNotebookSessionExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var createNotebookSessionDetails = new Oci.DatascienceService.Models.CreateNotebookSessionDetails
			{
				DisplayName = "EXAMPLE-displayName-Value",
				ProjectId = "ocid1.test.oc1..<unique_ID>EXAMPLE-projectId-Value",
				CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
				NotebookSessionConfigurationDetails = new Oci.DatascienceService.Models.NotebookSessionConfigurationDetails
				{
					Shape = "EXAMPLE-shape-Value",
					BlockStorageSizeInGBs = 354,
					SubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
					PrivateEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value",
					NotebookSessionShapeConfigDetails = new Oci.DatascienceService.Models.NotebookSessionShapeConfigDetails
					{
						Ocpus = (float)21.917538,
						MemoryInGBs = (float)652.5915,
						CpuBaseline = Oci.DatascienceService.Models.NotebookSessionShapeConfigDetails.CpuBaselineEnum.Baseline18
					}
				},
				NotebookSessionConfigDetails = new Oci.DatascienceService.Models.NotebookSessionConfigDetails
				{
					Shape = "EXAMPLE-shape-Value",
					BlockStorageSizeInGBs = 3477,
					SubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
					PrivateEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value",
					NotebookSessionShapeConfigDetails = new Oci.DatascienceService.Models.NotebookSessionShapeConfigDetails
					{
						Ocpus = (float)49.478394,
						MemoryInGBs = (float)713.4952,
						CpuBaseline = Oci.DatascienceService.Models.NotebookSessionShapeConfigDetails.CpuBaselineEnum.Baseline11
					}
				},
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_3d7N0", 
						"EXAMPLE_VALUE_Nd2aANEBKRrHZoWzkiKy"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_5Ej7p", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_cNrCi", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				NotebookSessionRuntimeConfigDetails = new Oci.DatascienceService.Models.NotebookSessionRuntimeConfigDetails
				{
					CustomEnvironmentVariables = new Dictionary<string, string>()
					{
						{
							"EXAMPLE_KEY_BETl9", 
							"EXAMPLE_VALUE_WFbXhRYstJXzZ1jPx6XR"
						}
					},
					NotebookSessionGitConfigDetails = new Oci.DatascienceService.Models.NotebookSessionGitConfigDetails
					{
						NotebookSessionGitRepoConfigCollection = new List<Oci.DatascienceService.Models.NotebookSessionGitRepoConfigDetails>
						{
							new Oci.DatascienceService.Models.NotebookSessionGitRepoConfigDetails
							{
								Url = "EXAMPLE-url-Value"
							}
						}
					}
				},
				NotebookSessionStorageMountConfigurationDetailsList = new List<Oci.DatascienceService.Models.StorageMountConfigurationDetails>
				{
					new Oci.DatascienceService.Models.ObjectStorageMountConfigurationDetails
					{
						Namespace = "EXAMPLE-namespace-Value",
						Bucket = "EXAMPLE-bucket-Value",
						Prefix = "EXAMPLE-prefix-Value",
						DestinationDirectoryName = "EXAMPLE-destinationDirectoryName-Value",
						DestinationPath = "EXAMPLE-destinationPath-Value"
					}
				}
			};
			var createNotebookSessionRequest = new Oci.DatascienceService.Requests.CreateNotebookSessionRequest
			{
				CreateNotebookSessionDetails = createNotebookSessionDetails,
				OpcRequestId = "KHIWDFICOHKFZGPFV4TF<unique_ID>",
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value"
			};

            // 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 DataScienceClient(provider, new ClientConfiguration()))
				{
					var response = await client.CreateNotebookSession(createNotebookSessionRequest);
					// Retrieve value from the response.
					var id = response.NotebookSession.Id;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"CreateNotebookSession Failed with {e.Message}");
                throw e;
            }
        }

    }
}