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

namespace Oci.Sdk.DotNet.Example.Desktops
{
    public class UpdateDesktopPoolExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var updateDesktopPoolDetails = new Oci.DesktopsService.Models.UpdateDesktopPoolDetails
			{
				DisplayName = "EXAMPLE-displayName-Value",
				Description = "EXAMPLE-description-Value",
				MaximumSize = 5947,
				StandbySize = 969,
				DevicePolicy = new Oci.DesktopsService.Models.DesktopDevicePolicy
				{
					ClipboardMode = Oci.DesktopsService.Models.DesktopDevicePolicy.ClipboardModeEnum.None,
					AudioMode = Oci.DesktopsService.Models.DesktopDevicePolicy.AudioModeEnum.None,
					CdmMode = Oci.DesktopsService.Models.DesktopDevicePolicy.CdmModeEnum.Readonly,
					IsPrintingEnabled = true,
					IsPointerEnabled = true,
					IsKeyboardEnabled = true,
					IsDisplayEnabled = true,
					IsVideoInputEnabled = true
				},
				AvailabilityPolicy = new Oci.DesktopsService.Models.DesktopAvailabilityPolicy
				{
					StartSchedule = new Oci.DesktopsService.Models.DesktopSchedule
					{
						CronExpression = "EXAMPLE-cronExpression-Value",
						Timezone = "EXAMPLE-timezone-Value"
					},
				},
				ContactDetails = "EXAMPLE-contactDetails-Value",
				TimeStartScheduled = DateTime.Parse("12/31/2008 21:23:20"),
				TimeStopScheduled = DateTime.Parse("02/02/2019 14:56:09"),
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_Aad66", 
						"EXAMPLE_VALUE_dB64ylSgwX7Bsp5DlNXF"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_nLD96", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_Po0YX", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				SessionLifecycleActions = new Oci.DesktopsService.Models.UpdateDesktopPoolDesktopSessionLifecycleActions
				{
					Inactivity = new Oci.DesktopsService.Models.InactivityConfig
					{
						Action = Oci.DesktopsService.Models.InactivityConfig.ActionEnum.None,
						GracePeriodInMinutes = 860
					},
					Disconnect = new Oci.DesktopsService.Models.DisconnectConfig
					{
						Action = Oci.DesktopsService.Models.DisconnectConfig.ActionEnum.Delete,
						GracePeriodInMinutes = 435
					}
				},
				Image = new Oci.DesktopsService.Models.UpdateDesktopImage
				{
					ImageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value"
				},
				NetworkConfiguration = new Oci.DesktopsService.Models.UpdateDesktopNetworkConfiguration
				{
					SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
					{
						{
							"EXAMPLE_KEY_9HyZh", 
							new Dictionary<string, Object>()
							{
								{
									"EXAMPLE_KEY_TxD8C", 
									"EXAMPLE--Value"
								}
							}
						}
					}
				},
				PrivateAccessDetails = new Oci.DesktopsService.Models.UpdateDesktopPoolPrivateAccessDetails
				{
					SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
					{
						{
							"EXAMPLE_KEY_gZSYG", 
							new Dictionary<string, Object>()
							{
								{
									"EXAMPLE_KEY_KRf2q", 
									"EXAMPLE--Value"
								}
							}
						}
					}
				},
				SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_lPJnL", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_5anxB", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				BootVolumeSizeInGBs = 9054
			};
			var updateDesktopPoolRequest = new Oci.DesktopsService.Requests.UpdateDesktopPoolRequest
			{
				DesktopPoolId = "ocid1.test.oc1..<unique_ID>EXAMPLE-desktopPoolId-Value",
				UpdateDesktopPoolDetails = updateDesktopPoolDetails,
				OpcRequestId = "FKX06TTFZG2BCMDNZFPW<unique_ID>",
				IfMatch = "EXAMPLE-ifMatch-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 DesktopServiceClient(provider, new ClientConfiguration()))
				{
					var response = await client.UpdateDesktopPool(updateDesktopPoolRequest);
					// Retrieve value from the response.
					var versionValue = response.httpResponseMessage.Version;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"UpdateDesktopPool Failed with {e.Message}");
                throw e;
            }
        }

    }
}