// 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 UpdateApplicationExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateApplicationDetails = new Oci.DataintegrationService.Models.UpdateApplicationDetails
{
Key = "EXAMPLE-key-Value",
ModelType = "EXAMPLE-modelType-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
Name = "EXAMPLE-name-Value",
Description = "EXAMPLE-description-Value",
ApplicationVersion = 676,
ObjectStatus = 604,
Identifier = "EXAMPLE-identifier-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
ObjectVersion = 732,
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("09/30/2026 04:35:48"),
TimeUpdated = DateTime.Parse("09/12/2024 12:29:05"),
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_1yNzF",
"EXAMPLE_VALUE_YcfcSdmt6IdYtgErdzgv"
}
},
RegistryVersion = 284,
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.UserDefinedFunction,
ObjectCount = 460
}
}
}
},
DisplayName = "EXAMPLE-displayName-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_J2Sgd",
"EXAMPLE_VALUE_jCSIF7VsgieoAwdSLazF"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_3m2I6",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_mRjR9",
"EXAMPLE--Value"
}
}
}
},
LifecycleState = Oci.DataintegrationService.Models.UpdateApplicationDetails.LifecycleStateEnum.Updating
};
var updateApplicationRequest = new Oci.DataintegrationService.Requests.UpdateApplicationRequest
{
WorkspaceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
ApplicationKey = "EXAMPLE-applicationKey-Value",
UpdateApplicationDetails = updateApplicationDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "UIQQK4F6ITV5D9JIDE1E<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.UpdateApplication(updateApplicationRequest);
// Retrieve value from the response.
var id = response.Application.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateApplication Failed with {e.Message}");
throw e;
}
}
}
}