// 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 UpdateDisApplicationExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var updateDisApplicationDetails = new Oci.DataintegrationService.Models.UpdateDisApplicationDetails
			{
				Key = "EXAMPLE-key-Value",
				ModelType = "EXAMPLE-modelType-Value",
				ModelVersion = "EXAMPLE-modelVersion-Value",
				Name = "EXAMPLE-name-Value",
				Description = "EXAMPLE-description-Value",
				ApplicationVersion = 75,
				ObjectStatus = 82,
				Identifier = "EXAMPLE-identifier-Value",
				ParentRef = new Oci.DataintegrationService.Models.ParentReference
				{
					Parent = "EXAMPLE-parent-Value",
					RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
				},
				ObjectVersion = 196,
				Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
				{
					CreatedBy = "EXAMPLE-createdBy-Value",
					CreatedByName = "EXAMPLE-createdByName-Value",
					UpdatedBy = "EXAMPLE-updatedBy-Value",
					UpdatedByName = "EXAMPLE-updatedByName-Value",
					TimeCreated = DateTime.Parse("05/15/2026 08:16:06"),
					TimeUpdated = DateTime.Parse("07/19/2012 17:05:36"),
					AggregatorKey = "EXAMPLE-aggregatorKey-Value",
					Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
					{
						Type = "EXAMPLE-type-Value",
						Key = "EXAMPLE-key-Value",
						Name = "EXAMPLE-name-Value",
						Identifier = "EXAMPLE-identifier-Value",
						Description = "EXAMPLE-description-Value"
					},
					IdentifierPath = "EXAMPLE-identifierPath-Value",
					InfoFields = new Dictionary<string, string>()
					{
						{
							"EXAMPLE_KEY_yVMC2", 
							"EXAMPLE_VALUE_vmlPzWkpGCKTrehfsC0P"
						}
					},
					RegistryVersion = 662,
					Labels = new List<string>
					{
						"EXAMPLE--Value"
					},
					IsFavorite = false,
					CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
					{
						ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
						{
							new Oci.DataintegrationService.Models.CountStatisticSummary
							{
								ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Task,
								ObjectCount = 752
							}
						}
					}
				},
				DisplayName = "EXAMPLE-displayName-Value",
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_Vh4A6", 
						"EXAMPLE_VALUE_y6ppv5ljKhWl6wPI6m39"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_foTnv", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_r2ImR", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				LifecycleState = Oci.DataintegrationService.Models.UpdateDisApplicationDetails.LifecycleStateEnum.Active
			};
			var updateDisApplicationRequest = new Oci.DataintegrationService.Requests.UpdateDisApplicationRequest
			{
				WorkspaceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
				DisApplicationId = "ocid1.test.oc1..<unique_ID>EXAMPLE-disApplicationId-Value",
				UpdateDisApplicationDetails = updateDisApplicationDetails,
				IfMatch = "EXAMPLE-ifMatch-Value",
				OpcRequestId = "PUCYTD8WQ0JWUTYEIFY0<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.UpdateDisApplication(updateDisApplicationRequest);
					// Retrieve value from the response.
					var id = response.DisApplication.Id;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"UpdateDisApplication Failed with {e.Message}");
                throw e;
            }
        }

    }
}