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

namespace Oci.Sdk.DotNet.Example.Managementdashboard
{
    public class ImportDashboardExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var managementDashboardImportDetails = new Oci.ManagementdashboardService.Models.ManagementDashboardImportDetails
			{
				Dashboards = new List<Oci.ManagementdashboardService.Models.ManagementDashboardForImportExportDetails>
				{
					new Oci.ManagementdashboardService.Models.ManagementDashboardForImportExportDetails
					{
						DashboardId = "ocid1.test.oc1..<unique_ID>EXAMPLE-dashboardId-Value",
						ProviderId = "ocid1.test.oc1..<unique_ID>EXAMPLE-providerId-Value",
						ProviderName = "EXAMPLE-providerName-Value",
						ProviderVersion = "EXAMPLE-providerVersion-Value",
						Tiles = new List<Oci.ManagementdashboardService.Models.ManagementDashboardTileDetails>
						{
							new Oci.ManagementdashboardService.Models.ManagementDashboardTileDetails
							{
								DisplayName = "EXAMPLE-displayName-Value",
								SavedSearchId = "ocid1.test.oc1..<unique_ID>EXAMPLE-savedSearchId-Value",
								Row = 447,
								Column = 348,
								Height = 700,
								Width = 791,
								Nls = "EXAMPLE-nls-Value",
								UiConfig = "EXAMPLE-uiConfig-Value",
								DataConfig = new List<Object>
								{
									"EXAMPLE-dataConfig-Value"
								},
								State = Oci.ManagementdashboardService.Models.ManagementDashboardTileDetails.StateEnum.Default,
								DrilldownConfig = "EXAMPLE-drilldownConfig-Value",
								ParametersMap = "EXAMPLE-parametersMap-Value"
							}
						},
						DisplayName = "EXAMPLE-displayName-Value",
						Description = "EXAMPLE-description-Value",
						CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
						IsOobDashboard = false,
						IsShowInHome = false,
						MetadataVersion = "EXAMPLE-metadataVersion-Value",
						IsShowDescription = true,
						ScreenImage = "EXAMPLE-screenImage-Value",
						Nls = "EXAMPLE-nls-Value",
						UiConfig = "EXAMPLE-uiConfig-Value",
						DataConfig = new List<Object>
						{
							"EXAMPLE-dataConfig-Value"
						},
						Type = "EXAMPLE-type-Value",
						IsFavorite = true,
						SavedSearches = new List<Oci.ManagementdashboardService.Models.ManagementSavedSearchForImportDetails>
						{
							new Oci.ManagementdashboardService.Models.ManagementSavedSearchForImportDetails
							{
								Id = "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
								DisplayName = "EXAMPLE-displayName-Value",
								ProviderId = "ocid1.test.oc1..<unique_ID>EXAMPLE-providerId-Value",
								ProviderVersion = "EXAMPLE-providerVersion-Value",
								ProviderName = "EXAMPLE-providerName-Value",
								CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
								IsOobSavedSearch = false,
								Description = "EXAMPLE-description-Value",
								Nls = "EXAMPLE-nls-Value",
								Type = Oci.ManagementdashboardService.Models.SavedSearchTypes.WidgetDontShowInDashboard,
								UiConfig = "EXAMPLE-uiConfig-Value",
								DataConfig = new List<Object>
								{
									"EXAMPLE-dataConfig-Value"
								},
								ScreenImage = "EXAMPLE-screenImage-Value",
								MetadataVersion = "EXAMPLE-metadataVersion-Value",
								WidgetTemplate = "EXAMPLE-widgetTemplate-Value",
								WidgetVM = "EXAMPLE-widgetVM-Value",
								FreeformTags = new Dictionary<string, string>()
								{
									{
										"EXAMPLE_KEY_YLBc3", 
										"EXAMPLE_VALUE_PeL4KvpN6LuXP3ljfHdr"
									}
								},
								DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
								{
									{
										"EXAMPLE_KEY_sXtIX", 
										new Dictionary<string, Object>()
										{
											{
												"EXAMPLE_KEY_ZgtNS", 
												"EXAMPLE--Value"
											}
										}
									}
								},
								ParametersConfig = new List<Object>
								{
									"EXAMPLE-parametersConfig-Value"
								},
								FeaturesConfig = "EXAMPLE-featuresConfig-Value",
								DrilldownConfig = new List<Object>
								{
									"EXAMPLE-drilldownConfig-Value"
								}
							}
						},
						ParametersConfig = new List<Object>
						{
							"EXAMPLE-parametersConfig-Value"
						},
						FeaturesConfig = "EXAMPLE-featuresConfig-Value",
						DrilldownConfig = new List<Object>
						{
							"EXAMPLE-drilldownConfig-Value"
						},
						FreeformTags = new Dictionary<string, string>()
						{
							{
								"EXAMPLE_KEY_PKpsa", 
								"EXAMPLE_VALUE_vYjJLglZoeSAGUu6jTbi"
							}
						},
						DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
						{
							{
								"EXAMPLE_KEY_uuyRY", 
								new Dictionary<string, Object>()
								{
									{
										"EXAMPLE_KEY_NOszQ", 
										"EXAMPLE--Value"
									}
								}
							}
						}
					}
				},
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_Rv30F", 
						"EXAMPLE_VALUE_23YEauQRq2B7O6JIVdTS"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_6ZyHU", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_B7uAJ", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var importDashboardRequest = new Oci.ManagementdashboardService.Requests.ImportDashboardRequest
			{
				ManagementDashboardImportDetails = managementDashboardImportDetails,
				IfMatch = "EXAMPLE-ifMatch-Value",
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
				OpcRequestId = "DS8EZLOOX53FTMOH2VLD<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 DashxApisClient(provider, new ClientConfiguration()))
				{
					var response = await client.ImportDashboard(importDashboardRequest);
					// Retrieve value from the response.
					var versionValue = response.httpResponseMessage.Version;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"ImportDashboard Failed with {e.Message}");
                throw e;
            }
        }

    }
}